-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  D:\Dropbox\jesarey_documents\Naming and Shaming\naming-and-shaming-replication\esarey-demeritt-nameshame.log
  log type:  text
 opened on:  10 Jun 2016, 10:35:09

. 
. *****************************************************
. * Create bilateral aid boxplots
. *****************************************************
. 
. 
. clear all

. set mem 1000M
set memory ignored.
    Memory no longer needs to be set in modern Statas; memory adjustments are performed on the fly automatically.

. set more off

. set matsize 800

. 
. use "ISQ 2010 Murdie Davis final to ISQ.dta", clear

. rename cowcode CCODE

. rename year YEAR

. save murdie_merge.dta, replace
file murdie_merge.dta saved

. 
. ** merge in public resolution data
. use jprworkdatanew.dta, clear

. 
. quietly{

. 
. 
. 
. gen d_lnBIPOP = BIPOP - l.BIPOP
(5,345 missing values generated)

. gen lagBIPOP = l.BIPOP
(5,210 missing values generated)

. 
. 
. twoway (kdensity d_lnBIPOP if(PUBRES==0 & lagBIPOP<3.25), range(-2 2)) (kdensity d_lnBIPOP if(PUBRES==1 & lagBIPOP<3.25) , range(-2 2)), name(panela, replace) ysize(5)
>  xsize(5) nodraw 

. twoway (kdensity d_lnBIPOP if(PUBRES==0 & lagBIPOP>=3.25), range(-2 2)) (kdensity d_lnBIPOP if(PUBRES==1 & lagBIPOP>=3.25) , range(-2 2)), name(panelb, replace) ysize(
> 5) xsize(5) nodraw 

. 
. graph hbox d_lnBIPOP if(lagBIPOP<3.25), over(PUBRES) name(panela, replace) nodraw yscale(r(-4 4)) ylabel(#5)

. graph hbox d_lnBIPOP if(lagBIPOP>=3.25), over(PUBRES) name(panelb, replace) nodraw yscale(r(-4 4)) ylabel(#5)

. graph combine panela panelb, rows(2) commonscheme scheme(s2mono) ysize(5) xsize(10)

. 
. reg d_lnBIPOP PUBRES if lagBIPOP<3.25

      Source |       SS           df       MS      Number of obs   =     1,353
-------------+----------------------------------   F(1, 1351)      =      0.00
       Model |  2.1114e-06         1  2.1114e-06   Prob > F        =    0.9982
    Residual |   543.97258     1,351  .402644396   R-squared       =    0.0000
-------------+----------------------------------   Adj R-squared   =   -0.0007
       Total |  543.972582     1,352  .402346584   Root MSE        =    .63454

------------------------------------------------------------------------------
   d_lnBIPOP |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      PUBRES |    .000131   .0571851     0.00   0.998    -.1120502    .1123121
       _cons |   .1219713   .0181968     6.70   0.000     .0862743    .1576682
------------------------------------------------------------------------------

. reg d_lnBIPOP PUBRES if lagBIPOP>=3.25

      Source |       SS           df       MS      Number of obs   =     1,442
-------------+----------------------------------   F(1, 1440)      =      0.03
       Model |  .011356123         1  .011356123   Prob > F        =    0.8550
    Residual |  489.668036     1,440  .340047247   R-squared       =    0.0000
-------------+----------------------------------   Adj R-squared   =   -0.0007
       Total |  489.679392     1,441  .339819148   Root MSE        =    .58314

------------------------------------------------------------------------------
   d_lnBIPOP |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      PUBRES |   .0127186   .0695975     0.18   0.855    -.1238047    .1492418
       _cons |  -.1237595   .0157662    -7.85   0.000    -.1546867   -.0928324
------------------------------------------------------------------------------

. 
. 
. 
. graph hbox d_lnBIPOP if(BIPOP<3.25), over(PUBRES) name(panela, replace) nodraw yscale(r(-4 4)) ylabel(#5)

. graph hbox d_lnBIPOP if(BIPOP>=3.25), over(PUBRES) name(panelb, replace) nodraw yscale(r(-4 4)) ylabel(#5)

. graph combine panela panelb, rows(2) commonscheme scheme(s2mono) ysize(5) xsize(10)

. 
. reg d_lnBIPOP PUBRES if BIPOP<3.25

      Source |       SS           df       MS      Number of obs   =     1,363
-------------+----------------------------------   F(1, 1361)      =      5.10
       Model |  1.92171583         1  1.92171583   Prob > F        =    0.0241
    Residual |  512.937611     1,361  .376882888   R-squared       =    0.0037
-------------+----------------------------------   Adj R-squared   =    0.0030
       Total |  514.859327     1,362  .378017127   Root MSE        =    .61391

------------------------------------------------------------------------------
   d_lnBIPOP |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      PUBRES |   .1248783   .0553026     2.26   0.024     .0163907    .2333659
       _cons |  -.1083025   .0175331    -6.18   0.000    -.1426973   -.0739077
------------------------------------------------------------------------------

. reg d_lnBIPOP PUBRES if BIPOP>=3.25

      Source |       SS           df       MS      Number of obs   =     1,432
-------------+----------------------------------   F(1, 1430)      =      0.00
       Model |  .000281777         1  .000281777   Prob > F        =    0.9782
    Residual |   538.55412     1,430  .376611273   R-squared       =    0.0000
-------------+----------------------------------   Adj R-squared   =   -0.0007
       Total |  538.554402     1,431  .376348289   Root MSE        =    .61369

------------------------------------------------------------------------------
   d_lnBIPOP |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      PUBRES |   .0020038   .0732576     0.03   0.978       -.1417    .1457076
       _cons |   .0823217   .0166532     4.94   0.000     .0496545     .114989
------------------------------------------------------------------------------

. 
. 
. graph hbox BIPOP if(lagBIPOP<3.25), over(PUBRES, relabel(1 "not condemned" 2 "condemned")) name(panela, replace) nodraw yscale(r(0 8)) ylabel(#5) ytitle("ln(aggregate 
> bilateral aid PC + 1)") title("lag ln(aggregate bilateral aid PC + 1) < 3.25")

. 
. graph hbox BIPOP if(lagBIPOP>=3.25),over(PUBRES, relabel(1 "not condemned" 2 "condemned")) name(panelb, replace) nodraw yscale(r(0 8))  ylabel(#5) ytitle("ln(aggregate
>  bilateral aid PC + 1)") title("lag ln(aggregate bilateral aid PC + 1) {&ge} 3.25")

. 
. graph combine panela panelb, cols(1) commonscheme scheme(s2mono) ysize(5) xsize(10)

. 
. graph export aid_by_lag.eps, replace
(file aid_by_lag.eps written in EPS format)

. 
. tobit BIPOP PUBRES if BIPOP<3.25, ll(0)

Tobit regression                                Number of obs     =      1,434
                                                LR chi2(1)        =      35.72
                                                Prob > chi2       =     0.0000
Log likelihood = -2091.2731                     Pseudo R2         =     0.0085

------------------------------------------------------------------------------
       BIPOP |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      PUBRES |  -.5659747   .0941707    -6.01   0.000     -.750702   -.3812475
       _cons |   2.017772   .0292062    69.09   0.000      1.96048    2.075063
-------------+----------------------------------------------------------------
      /sigma |   1.047012   .0206006                      1.006602    1.087423
------------------------------------------------------------------------------
            90  left-censored observations at BIPOP <= 0
         1,344     uncensored observations
             0 right-censored observations

. tobit BIPOP PUBRES if BIPOP>=3.25, ll(0)

Tobit regression                                Number of obs     =      1,496
                                                LR chi2(1)        =       3.14
                                                Prob > chi2       =     0.0762
Log likelihood = -1576.6951                     Pseudo R2         =     0.0010

------------------------------------------------------------------------------
       BIPOP |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      PUBRES |   .1450199   .0817329     1.77   0.076    -.0153034    .3053433
       _cons |    4.16631   .0184221   226.16   0.000     4.130174    4.202446
-------------+----------------------------------------------------------------
      /sigma |   .6941981   .0126911                      .6693038    .7190923
------------------------------------------------------------------------------
             0  left-censored observations
         1,496     uncensored observations
             0 right-censored observations

. 
. 
. 
. gen ngodum = .
(8,140 missing values generated)

. replace ngodum = 1 if l.HRnc2gcnc2>=1 & l.HRnc2gcnc2!=.
(249 real changes made)

. replace ngodum = 0 if l.HRnc2gcnc2<1 & l.HRnc2gcnc2!=.
(3,429 real changes made)

. 
. graph hbox BIPOP if(lagBIPOP<3.25), over(ngodum, relabel(1 "no shaming events" 2 "any shaming events")) name(panela, replace) nodraw yscale(r(0 8)) ylabel(#5) ytitle("
> ln(aggregate bilateral aid PC + 1)") title("lag ln(aggregate bilateral aid PC + 1) < 3.25")

. 
. graph hbox BIPOP if(lagBIPOP>=3.25),over(ngodum,  relabel(1 "no shaming events" 2 "any shaming events"))  name(panelb, replace) nodraw yscale(r(0 8))  ylabel(#5) ytitl
> e("ln(aggregate bilateral aid PC + 1)") title("lag ln(aggregate bilateral aid PC + 1) {&ge} 3.25")

. 
. graph combine panela panelb, cols(1) commonscheme scheme(s2mono) ysize(5) xsize(10)

. 
. graph export aid_by_lag_ngo.eps, replace
(file aid_by_lag_ngo.eps written in EPS format)

. 
. tobit BIPOP ngodum if BIPOP<3.25, ll(0)

Tobit regression                                Number of obs     =        650
                                                LR chi2(1)        =       7.54
                                                Prob > chi2       =     0.0060
Log likelihood = -909.85146                     Pseudo R2         =     0.0041

------------------------------------------------------------------------------
       BIPOP |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      ngodum |  -.3310329   .1202975    -2.75   0.006    -.5672522   -.0948136
       _cons |    2.11724   .0409735    51.67   0.000     2.036783    2.197696
-------------+----------------------------------------------------------------
      /sigma |   .9794553   .0282828                      .9239183    1.034992
------------------------------------------------------------------------------
            31  left-censored observations at BIPOP <= 0
           619     uncensored observations
             0 right-censored observations

. tobit BIPOP ngodum if BIPOP>=3.25, ll(0)

Tobit regression                                Number of obs     =        521
                                                LR chi2(1)        =       5.39
                                                Prob > chi2       =     0.0203
Log likelihood = -491.53779                     Pseudo R2         =     0.0055

------------------------------------------------------------------------------
       BIPOP |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
      ngodum |  -.2859069    .122849    -2.33   0.020    -.5272483   -.0445655
       _cons |   4.072962   .0279663   145.64   0.000     4.018021    4.127902
-------------+----------------------------------------------------------------
      /sigma |   .6215817   .0192559                      .5837528    .6594107
------------------------------------------------------------------------------
             0  left-censored observations
           521     uncensored observations
             0 right-censored observations

. 
. gen lagdum = .
(8,140 missing values generated)

. replace lagdum = 1 if BIPOP>=3.25 & BIPOP!=.
(1,496 real changes made)

. replace lagdum = 0 if BIPOP<3.25 & BIPOP!=.
(1,434 real changes made)

. xi: tobit BIPOP i.ngodum*i.lagdum, ll(0)
i.ngodum          _Ingodum_0-1        (naturally coded; _Ingodum_0 omitted)
i.lagdum          _Ilagdum_0-1        (naturally coded; _Ilagdum_0 omitted)
i.ngo~m*i.lag~m   _IngoXlag_#_#       (coded as above)

Tobit regression                                Number of obs     =      1,171
                                                LR chi2(3)        =    1019.11
                                                Prob > chi2       =     0.0000
Log likelihood = -1456.0267                     Pseudo R2         =     0.2592

-------------------------------------------------------------------------------
        BIPOP |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
   _Ingodum_1 |    -.32489   .1021221    -3.18   0.002    -.5252533   -.1245267
   _Ilagdum_1 |   1.952394   .0511229    38.19   0.000     1.852091    2.052697
_IngoXlag_1_1 |   .0389831   .1936194     0.20   0.840    -.3408976    .4188638
        _cons |   2.120568   .0348028    60.93   0.000     2.052285    2.188851
--------------+----------------------------------------------------------------
       /sigma |   .8323166   .0175946                       .797796    .8668373
-------------------------------------------------------------------------------
            31  left-censored observations at BIPOP <= 0
         1,140     uncensored observations
             0 right-censored observations

. 
. 
. gen PUBRES_jit = PUBRES + (0.75* (runiform() - 0.5) )
(5,164 missing values generated)

. twoway (scatter PUBRES_jit l.HRnc2gcnc2 if(l.HRnc2gcnc2 < 11)) (qfit PUBRES l.HRnc2gcnc2), ytitle("UNCHR Resolution (with jitter)") xtitle("Count of NGO Shaming Events
> ") legend(label(1 "Recipient Country-Year") label(2 "Quadratic Fit")) ylabel(0 "No" 1 "Yes") scheme(s2mono)

. 
. graph export pubresVsNgo.eps, replace
(file pubresVsNgo.eps written in EPS format)

. 
. unique COUNTRY if e(sample)
Number of unique values of COUNTRY is  119
Number of records is  1171

. tab YEAR if e(sample)

       year |      Freq.     Percent        Cum.
------------+-----------------------------------
       1993 |        108        9.22        9.22
       1994 |        122       10.42       19.64
       1995 |        122       10.42       30.06
       1996 |        117        9.99       40.05
       1997 |        118       10.08       50.13
       1998 |        118       10.08       60.20
       1999 |        117        9.99       70.20
       2000 |        115        9.82       80.02
       2001 |        115        9.82       89.84
       2002 |        119       10.16      100.00
------------+-----------------------------------
      Total |      1,171      100.00

. 
. sum PUBRES l.HRnc2gcnc2 if e(sample)

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      PUBRES |      1,171    .0811272    .2731471          0          1
             |
  HRnc2gcnc2 |
         L1. |      1,171    .2263023    .9594469          0         10

. gen lagHRnc2gcnc2 = l.HRnc2gcnc2
(4,462 missing values generated)

. tab lagHRnc2gcnc2 PUBRES if e(sample)

lagHRnc2gc |   public resolution
       nc2 |         0          1 |     Total
-----------+----------------------+----------
         0 |       989         79 |     1,068 
         1 |        38          6 |        44 
         2 |        20          5 |        25 
         3 |        10          1 |        11 
         4 |         5          1 |         6 
         5 |         3          0 |         3 
         6 |         6          1 |         7 
         7 |         2          0 |         2 
         8 |         1          2 |         3 
         9 |         1          0 |         1 
        10 |         1          0 |         1 
-----------+----------------------+----------
     Total |     1,076         95 |     1,171 


. sum PUBRES ngodum if e(sample)

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      PUBRES |      1,171    .0811272    .2731471          0          1
      ngodum |      1,171     .087959    .2833563          0          1

. tab ngodum PUBRES if e(sample), column row

+-------------------+
| Key               |
|-------------------|
|     frequency     |
|  row percentage   |
| column percentage |
+-------------------+

           |   public resolution
    ngodum |         0          1 |     Total
-----------+----------------------+----------
         0 |       989         79 |     1,068 
           |     92.60       7.40 |    100.00 
           |     91.91      83.16 |     91.20 
-----------+----------------------+----------
         1 |        87         16 |       103 
           |     84.47      15.53 |    100.00 
           |      8.09      16.84 |      8.80 
-----------+----------------------+----------
     Total |     1,076         95 |     1,171 
           |     91.89       8.11 |    100.00 
           |    100.00     100.00 |    100.00 


. 
. gen HRnc2gcnc2_sq = (l.HRnc2gcnc2)^2
(4,462 missing values generated)

. reg PUBRES l.HRnc2gcnc2 HRnc2gcnc2_sq

      Source |       SS           df       MS      Number of obs   =     1,184
-------------+----------------------------------   F(2, 1181)      =      4.18
       Model |   .67758616         2   .33879308   Prob > F        =    0.0156
    Residual |   95.832549     1,181  .081145257   R-squared       =    0.0070
-------------+----------------------------------   Adj R-squared   =    0.0053
       Total |  96.5101351     1,183  .081580841   Root MSE        =    .28486

-------------------------------------------------------------------------------
       PUBRES |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
--------------+----------------------------------------------------------------
   HRnc2gcnc2 |
          L1. |   .0373268   .0221764     1.68   0.093    -.0061827    .0808363
              |
HRnc2gcnc2_sq |  -.0021952   .0033879    -0.65   0.517    -.0088421    .0044517
        _cons |   .0831583   .0086095     9.66   0.000     .0662667    .1000499
-------------------------------------------------------------------------------

. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |      1,184 -195.8758  -191.7048       3    389.4096   404.6395
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. 
. reg PUBRES l.HRnc2gcnc2

      Source |       SS           df       MS      Number of obs   =     1,184
-------------+----------------------------------   F(1, 1182)      =      7.93
       Model |  .643517529         1  .643517529   Prob > F        =    0.0049
    Residual |  95.8666176     1,182  .081105429   R-squared       =    0.0067
-------------+----------------------------------   Adj R-squared   =    0.0058
       Total |  96.5101351     1,183  .081580841   Root MSE        =    .28479

------------------------------------------------------------------------------
      PUBRES |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  HRnc2gcnc2 |
         L1. |   .0240674   .0085442     2.82   0.005     .0073038    .0408309
             |
       _cons |   .0840184   .0085045     9.88   0.000     .0673329    .1007039
------------------------------------------------------------------------------

. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |      1,184 -195.8758  -191.9152       2    387.8304   397.9837
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. 
. gen lagHRIGHTS = l.HRIGHTS
(5,164 missing values generated)

. gen lagCIVIL = l.CIVIL
(5,474 missing values generated)

. gen lagGDPPOP = l.GDPPOP
(5,401 missing values generated)

. gen lagLNPOP = l.LNPOP
(5,181 missing values generated)

. gen lagUSAGREE = l.USAGREE
(5,164 missing values generated)

. 
. label variable BIPOP "ln (Bilateral aid PC + 1)"

. label variable lagBIPOP "lag ln (Bilateral aid PC + 1)"

. label variable lagHRIGHTS "lag Personal Integrity Abuse"

. label variable lagCIVIL "lag Civil Liberties"

. label variable lagGDPPOP "lag ln GDP per capita"

. label variable lagLNPOP "lag ln Population"

. label variable lagUSAGREE "lag Agreement with USA"

. label variable WAR "lag War"

. label variable CAPAB "lag CINC Capabilities"

. label variable PUBRES "lag UNCHR resolution"

. 
. label define PUBRES 0 "No Resolution" 1 "Resolution Passed"

. label values PUBRES PUBRES

. 
. bysort PUBRES: eststo: estpost summarize BIPOP lagBIPOP lagCIVIL lagGDPPOP lagLNPOP lagUSAGREE WAR CAPAB polity2 if lagHRIGHTS < 2.5

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> No Resolution

             |  e(count)   e(sum_w)    e(mean)     e(Var)      e(sd)     e(min)     e(max)     e(sum) 
-------------+----------------------------------------------------------------------------------------
       BIPOP |      1290       1290   3.524559   1.676551   1.294817          0   7.277433   4546.681 
    lagBIPOP |      1290       1290   3.547869   1.733224    1.31652          0   7.277433   4576.751 
    lagCIVIL |      1023       1023   4.420332   2.619625   1.618526          1          7       4522 
   lagGDPPOP |      1238       1238   7.044858   1.523549   1.234321     4.6079   10.45537   8721.534 
    lagLNPOP |      1296       1296   14.48403   2.577622   1.605498   11.39639   20.79092   18771.31 
  lagUSAGREE |      1297       1297   .3618212   .0142716   .1194637          0          1   469.2821 
         WAR |      1213       1213   .0519373   .0492805   .2219921          0          1         63 
       CAPAB |      1297       1297   .0055394   .0007385   .0271754   .0000171   .6627434    7.18465 
     polity2 |      1020       1020  -.6294118   55.19913   7.429612        -10         10       -642 
(est1 stored)

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> Resolution Passed

             |  e(count)   e(sum_w)    e(mean)     e(Var)      e(sd)     e(min)     e(max)     e(sum) 
-------------+----------------------------------------------------------------------------------------
       BIPOP |        20         20   4.542209   1.528207   1.236207    2.82429   6.641627   90.84418 
    lagBIPOP |        20         20   4.589385   1.505212   1.226871    2.82429   6.641627    91.7877 
    lagCIVIL |        20         20       4.55   4.155263   2.038446          2          7         91 
   lagGDPPOP |        17         17   7.369948   1.735422   1.317354   5.541766   8.806092   125.2891 
    lagLNPOP |        20         20   14.17515   2.921859   1.709344   12.35531   17.18968   283.5029 
  lagUSAGREE |        20         20   .4490312   .0527987   .2297796   .2105263   .8051948   8.980625 
         WAR |        20         20         .3   .2210526   .4701623          0          1          6 
       CAPAB |        20         20   .0088913   .0000948   .0097345   .0002222   .0223486   .1778258 
     polity2 |        20         20       -.35   64.87105   8.054257         -7         10         -7 
(est2 stored)

. bysort PUBRES: eststo: estpost summarize BIPOP lagBIPOP lagCIVIL lagGDPPOP lagLNPOP lagUSAGREE WAR CAPAB polity2 if lagHRIGHTS >= 2.5

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> No Resolution

             |  e(count)   e(sum_w)    e(mean)     e(Var)      e(sd)     e(min)     e(max)     e(sum) 
-------------+----------------------------------------------------------------------------------------
       BIPOP |      1425       1425   2.816047   1.753065   1.324034          0   7.258154   4012.867 
    lagBIPOP |      1295       1295   2.795697   1.669652    1.29215          0    6.14781   3620.428 
    lagCIVIL |      1289       1289   4.997673    1.95574   1.398478          1          7       6442 
   lagGDPPOP |      1207       1207   6.600011   1.221063   1.105017   3.899875   9.586818   7966.213 
    lagLNPOP |      1307       1307   16.37425   2.486149   1.576753   11.39639   20.96228   21401.14 
  lagUSAGREE |      1311       1311   .3463799   .0141325   .1188801       .125   .7173913   454.1041 
         WAR |      1434       1434   .4051604   .2411736   .4910943          0          1        581 
       CAPAB |      1442       1442   .0342352   .0091477   .0956438   .0000228   .7338794   49.36716 
     polity2 |      1302       1302  -1.537634   44.05508     6.6374        -10         10      -2002 
(est3 stored)

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> Resolution Passed

             |  e(count)   e(sum_w)    e(mean)     e(Var)      e(sd)     e(min)     e(max)     e(sum) 
-------------+----------------------------------------------------------------------------------------
       BIPOP |       195        195   2.283608   2.321926   1.523787          0   6.360202   445.3035 
    lagBIPOP |       193        193   2.195379   2.342769   1.530611          0   6.582603   423.7082 
    lagCIVIL |       212        212   5.849057   1.588483    1.26035          2          7       1240 
   lagGDPPOP |       149        149   6.649264   1.215306   1.102409   4.482747    8.84052   990.7404 
    lagLNPOP |       203        203   16.37463    1.63889   1.280191   12.29683   19.04662    3324.05 
  lagUSAGREE |       213        213   .3383339   .0150425    .122648          0   .8535354   72.06513 
         WAR |       217        217   .6774194   .2195341   .4685446          0          1        147 
       CAPAB |       217        217   .0197824   .0004124   .0203075   .0002108   .0839823   4.292776 
     polity2 |       187        187  -2.395722   34.12213   5.841415         -9         10       -448 
(est4 stored)

. esttab using unchr-summary.tex, cells(mean(fmt(3)) sd(par fmt(3)) ) label nodepvar varwidth(30) modelwidth(26) mtitles("\shortstack{low abuse\\no resolution}" "\shorts
> tack{low abuse\\resolution passed}" "\shortstack{high abuse\\no resolution}" "\shortstack{high abuse\\resolution passed}") nonumbers title("Summary Statistics for Stat
> e-Years, by UNCHR Shaming Resolution Status and Lagged Personal Integrity Abuse Score*\label{tab:unchrsum-1}") replace
(output written to unchr-summary.tex)

. estimates clear

. 
. label define ngodum 0 "No Shaming" 1 "Shaming"

. label values ngodum ngodum

. 
. bysort ngodum: eststo: estpost summarize BIPOP lagBIPOP lagCIVIL lagGDPPOP lagLNPOP lagUSAGREE WAR CAPAB polity2 if lagHRIGHTS < 2.5

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> No Shaming

             |  e(count)   e(sum_w)    e(mean)     e(Var)      e(sd)     e(min)     e(max)     e(sum) 
-------------+----------------------------------------------------------------------------------------
       BIPOP |       530        530   3.394307   1.320165   1.148984          0    6.39162   1798.983 
    lagBIPOP |       581        581   3.395177   1.360255     1.1663          0    6.39162   1972.598 
    lagCIVIL |       446        446   4.136771   2.585746   1.608025          1          7       1845 
   lagGDPPOP |       576        576   7.098508   1.499082    1.22437    4.94871   10.07722   4088.741 
    lagLNPOP |       581        581   14.59193    2.46913   1.571347   11.46478   18.69071   8477.911 
  lagUSAGREE |       581        581   .3614864   .0093562   .0967272          0   .7432432   210.0236 
         WAR |       490        490   .0530612   .0503485   .2243847          0          1         26 
       CAPAB |       530        530   .0045541   .0001003   .0100136   .0000171   .1325874   2.413651 
     polity2 |       454        454   1.944934   45.70778   6.760753        -10         10        883 
(est1 stored)

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> Shaming

             |  e(count)   e(sum_w)    e(mean)     e(Var)      e(sd)     e(min)     e(max)     e(sum) 
-------------+----------------------------------------------------------------------------------------
       BIPOP |        18         18   3.000806    .975267   .9875561   .5508301   4.493371   54.01451 
    lagBIPOP |        25         25   2.781618   .7749331   .8803028   .4267591   4.027087   69.54045 
    lagCIVIL |        25         25       4.64       1.74   1.319091          2          7        116 
   lagGDPPOP |        25         25   7.019179   .8652286   .9301766   5.602807   8.823884   175.4795 
    lagLNPOP |        25         25    15.9924    2.63784   1.624143   13.64783    18.6597     399.81 
  lagUSAGREE |        25         25   .3499169   .0079381   .0890958   .2037037   .5655738   8.747923 
         WAR |        18         18   .0555556   .0555556   .2357023          0          1          1 
       CAPAB |        18         18   .0123956   .0002027   .0142389   .0003418   .0428001   .2231211 
     polity2 |        20         20       -1.9   41.67368   6.455516         -9          9        -38 
(est2 stored)

. bysort ngodum: eststo: estpost summarize BIPOP lagBIPOP lagCIVIL lagGDPPOP lagLNPOP lagUSAGREE WAR CAPAB polity2 if lagHRIGHTS >= 2.5

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> No Shaming

             |  e(count)   e(sum_w)    e(mean)     e(Var)      e(sd)     e(min)     e(max)     e(sum) 
-------------+----------------------------------------------------------------------------------------
       BIPOP |       538        538   2.669822   1.559405   1.248761          0   5.975066   1436.364 
    lagBIPOP |       574        574   2.733246   1.572323   1.253923          0   5.921216   1568.883 
    lagCIVIL |       580        580   4.875862   2.070919   1.439069          1          7       2828 
   lagGDPPOP |       535        535   6.632259    1.24906   1.117614   4.037098    9.59977   3548.259 
    lagLNPOP |       575        575   16.35445   2.143752   1.464156   12.82201   20.94641   9403.811 
  lagUSAGREE |       587        587   .3331786   .0082744   .0909639       .125   .7638889   195.5758 
         WAR |       560        560   .3892857   .2381676   .4880242          0          1        218 
       CAPAB |       550        550   .0288236   .0055128   .0742483   .0000741   .7318628   15.85295 
     polity2 |      1567       1567   3.106573   44.71469   6.686904        -10         10       4868 
(est3 stored)

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-> Shaming

             |  e(count)   e(sum_w)    e(mean)     e(Var)      e(sd)     e(min)     e(max)     e(sum) 
-------------+----------------------------------------------------------------------------------------
       BIPOP |        85         85   2.200911   1.762394   1.327552          0   4.584807   187.0775 
    lagBIPOP |       105        105   2.218788   1.772101   1.331203          0   4.675394   232.9728 
    lagCIVIL |       107        107   5.205607   1.636572   1.279286          2          7        557 
   lagGDPPOP |       104        104   6.690323    1.25673    1.12104   4.486538   9.114063   695.7936 
    lagLNPOP |       105        105   17.34905   2.970921   1.723636   13.71015   20.97013    1821.65 
  lagUSAGREE |       107        107   .3281798   .0063951   .0799696   .1830986   .6666667   35.11523 
         WAR |        86         86   .5116279   .2528044   .5027966          0          1         44 
       CAPAB |        86         86    .093488   .0351515   .1874872   .0003589   .7338794   8.039969 
     polity2 |       203        203    3.29064   46.80125   6.841144        -10         10        668 
(est4 stored)

. esttab using ngo-summary.tex, cells(mean(fmt(3)) sd(par fmt(3)) ) label nodepvar varwidth(30) modelwidth(26) mtitles("\shortstack{low abuse\\no shaming}" "\shortstack{
> low abuse\\shaming}" "\shortstack{high abuse\\no shaming}" "\shortstack{high abuse\\shaming}") nonumbers title("Summary Statistics for State-Years, by Murdie and Davis
>  (2012) NGO Shaming Status and Lagged Personal Integrity Abuse Score*\label{tab:ngosum-1}") replace
(output written to ngo-summary.tex)

. estimates clear

. 
. *****************************************************
. * Create aid flow data plots for Guatemala and
. * El Salvador
. *****************************************************
. 
. 
. 
. clear all

. set mem 1000M
set memory ignored.
    Memory no longer needs to be set in modern Statas; memory adjustments are performed on the fly automatically.

. set more off

. set matsize 800

. 
. 
. ** merge in public resolution data
. use jprworkdatanew.dta, clear

. 
. quietly{

. 
. rename YEAR year 

. rename CCODE countrynumcode_g

. save jpr_merge.dta, replace
file jpr_merge.dta saved

. 
. use "dat2.dta", clear

. 
. merge m:1 year countrynumcode_g year using jpr_merge.dta

    Result                           # of obs.
    -----------------------------------------
    not matched                        61,704
        from master                    60,942  (_merge==1)
        from using                        762  (_merge==2)

    matched                            59,115  (_merge==3)
    -----------------------------------------

. 
. gen PUBRES_plot = 12*PUBRES
(64,763 missing values generated)

. 
. twoway  (bar PUBRES_plot year if countryname=="Guatemala", color(gs13)) (scatter lneconaidpc year if countryname=="Guatemala" & donorname=="United States") (lowess lne
> conaidpc year if countryname=="Guatemala" & donorname=="United States" & year>1980, bwidth(0.3)) (scatter lneconaidpc year if countryname=="Guatemala" & donorname=="Be
> lgium") (lowess lneconaidpc year if countryname=="Guatemala" & donorname=="Belgium", bwidth(0.3)), legend(holes(2) label(1 "Guatemala condemned by UNCHR resolution") l
> abel(2 "ln(aid PC + 1) from the US") label(3 "smoothed aid from the US") label(4 "ln(aid PC + 1) from Belgium") label(5 "smoothed aid from Belgium")) scheme(s2mono) gr
> aphregion(fcolor("white")) ylabel(0 2 4 6 8 10)

. 
. 
. gr_edit .legend.plotregion1.label[1].xoffset = 18

. gr_edit .legend.plotregion1.key[1].xoffset = 18

. gr_edit .legend.plotregion1.label[3].xoffset = -10

. gr_edit .legend.plotregion1.key[3].xoffset = -10

. gr_edit .legend.plotregion1.label[5].xoffset = -10

. gr_edit .legend.plotregion1.key[5].xoffset = -10

. 
. 
. drop PUBRES_plot

. 
. graph export guatemala-dyad-aid.eps, replace
(file guatemala-dyad-aid.eps written in EPS format)

. 
. 
. * how much does Guatemalan aid change?
. list lneconaidpc year countryname donorname PUBRES if countryname=="Guatemala" & donorname=="United States"

        +------------------------------------------------------+
        | lnecon~c   year   country~e       donorname   PUBRES |
        |------------------------------------------------------|
   228. |        0   1980   Guatemala   United States        1 |
  4159. | 6.822223   1981   Guatemala   United States        1 |
  8185. | 5.261324   1982   Guatemala   United States        1 |
 12231. | 7.899117   1983   Guatemala   United States        1 |
 16274. | 7.793484   1984   Guatemala   United States        1 |
        |------------------------------------------------------|
 20493. |  7.92479   1985   Guatemala   United States        1 |
 24681. | 8.955003   1986   Guatemala   United States        1 |
 28881. | 9.466022   1987   Guatemala   United States        1 |
 33140. | 9.250107   1988   Guatemala   United States        1 |
 37365. | 9.152349   1989   Guatemala   United States        0 |
        |------------------------------------------------------|
 41503. | 8.833164   1990   Guatemala   United States        0 |
 45725. | 8.150029   1991   Guatemala   United States        0 |
 50240. | 6.769092   1992   Guatemala   United States        0 |
 54804. | 5.727115   1993   Guatemala   United States        0 |
 59383. | 6.373002   1994   Guatemala   United States        0 |
        |------------------------------------------------------|
 63961. | 6.592628   1995   Guatemala   United States        0 |
 68709. | 5.117687   1996   Guatemala   United States        0 |
 73312. | 5.362251   1997   Guatemala   United States        0 |
 77908. | 6.643173   1998   Guatemala   United States        0 |
 82600. | 8.176585   1999   Guatemala   United States        0 |
        |------------------------------------------------------|
 87340. | 7.275351   2000   Guatemala   United States        0 |
 92156. | 7.194093   2001   Guatemala   United States        0 |
 96892. |  7.59407   2002   Guatemala   United States        0 |
101641. | 7.439058   2003   Guatemala   United States        . |
106370. | 6.976346   2004   Guatemala   United States        . |
        |------------------------------------------------------|
111218. |        .   2005   Guatemala   United States        . |
115789. |        .   2006   Guatemala   United States        . |
        +------------------------------------------------------+

. display exp(9.250107) - 1
10404.679

. display exp(7.899117) - 1
2693.9017

. 
. gen PUBRES_plot = 12*PUBRES
(64,763 missing values generated)

. 
. twoway  (bar PUBRES_plot year if countryname=="El Salvador", color(gs13)) (scatter lneconaidpc year if countryname=="El Salvador" & donorname=="United States") (lowess
>  lneconaidpc year if countryname=="El Salvador" & donorname=="United States", bwidth(0.3)) (scatter lneconaidpc year if countryname=="El Salvador" & donorname=="Belgiu
> m") (lowess lneconaidpc year if countryname=="El Salvador" & donorname=="Belgium", bwidth(0.3)), legend(holes(2) label(1 "El Salvador condemned by UNCHR resolution") l
> abel(2 "ln( aid PC + 1) from the US") label(3 "smoothed aid from the US") label(4 "ln(aid PC + 1) from Belgium") label(5 "smoothed aid from Belgium")) scheme(s2mono) g
> raphregion(fcolor("white")) ylabel(0 2 4 6 8 10 12)

. 
. 
. gr_edit .legend.plotregion1.label[1].xoffset = 18

. gr_edit .legend.plotregion1.key[1].xoffset = 18

. gr_edit .legend.plotregion1.label[3].xoffset = -10

. gr_edit .legend.plotregion1.key[3].xoffset = -10

. gr_edit .legend.plotregion1.label[5].xoffset = -10

. gr_edit .legend.plotregion1.key[5].xoffset = -10

. 
. 
. drop PUBRES_plot

. 
. graph export elsalvador-dyad-aid.eps, replace
(file elsalvador-dyad-aid.eps written in EPS format)

. 
. 
. 
. 
. *****************************************************
. * Neilsen data
. * dyadic aid flow analysis
. * Lebovic/Voeten UNCHR condemnation variable
. *****************************************************
. 
. * create common sample for old and new models
. 
. clear all

. set mem 1000M
set memory ignored.
    Memory no longer needs to be set in modern Statas; memory adjustments are performed on the fly automatically.

. set more off

. set matsize 800

. 
. 
. ** merge in public resolution data
. use jprworkdatanew.dta, clear

. rename YEAR year 

. rename CCODE countrynumcode_g

. save jpr_merge.dta, replace
file jpr_merge.dta saved

. 
. use "dat2.dta", clear

. 
. merge m:1 year countrynumcode_g year using jpr_merge.dta

    Result                           # of obs.
    -----------------------------------------
    not matched                        51,079
        from master                    50,316  (_merge==1)
        from using                        763  (_merge==2)

    matched                            69,741  (_merge==3)
    -----------------------------------------

. drop if _merge==2
(763 observations deleted)

. 
. tsset dyadnum year
       panel variable:  dyadnum (unbalanced)
        time variable:  year, 1980 to 2006, but with gaps
                delta:  1 unit

. 
. gen allXpub = PUBRES*l.alliance
(66,759 missing values generated)

. gen neiXpub = PUBRES*l.donorallyneighbor2
(66,633 missing values generated)

. gen s3unXpub = PUBRES*l.s3un
(66,693 missing values generated)

. 
. gen lagXpub = PUBRES*l.lneconaidpc
(66,864 missing values generated)

. 
. * the neilsen model
. eststo neilsen: xttobit lneconaidpc l.physint l.alliance l.alliance_physint l.donorallyneighbor2 l.allyneighbor2_physint l.s3un l.s3un_physint l.lnreftotal l.lnreftota
> l_physint l.lnnytimes l.lnnytimes_physint l.ratpercent l.ratpercent_physint l.donor_physint l.donor_physint_physint l.polity2 l.lneconaidpc lnworldaidecon l.ln_rgdpc l
> .ln_population l.ln_trade dyad_colony socialist ColdWar coldwarsoc l.ColdWar_physint l.war post2001 region_SSA region_Latin region_MENA region_EAsiaPac if(inmysample==
> 1), ll(0) intpoints(20)

Obtaining starting values for full model:

Iteration 0:   log likelihood = -85542.325
Iteration 1:   log likelihood = -84268.758
Iteration 2:   log likelihood = -84152.161
Iteration 3:   log likelihood = -84150.536
Iteration 4:   log likelihood = -84150.534

Fitting full model:

Iteration 0:   log likelihood = -63223.892  
Iteration 1:   log likelihood =  -56351.79  
Iteration 2:   log likelihood = -52870.679  
Iteration 3:   log likelihood = -52561.791  
Iteration 4:   log likelihood = -52496.912  
Iteration 5:   log likelihood = -52496.638  
Iteration 6:   log likelihood = -52496.638  

Random-effects tobit regression                 Number of obs     =     41,935
Group variable: dyadnum                         Number of groups  =      2,364

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          1
                                                              avg =       17.7
                                                              max =         22

Integration method: mvaghermite                 Integration pts.  =         20

                                                Wald chi2(32)     =    5480.53
Log likelihood  = -52496.638                    Prob > chi2       =     0.0000

---------------------------------------------------------------------------------------
          lneconaidpc |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
----------------------+----------------------------------------------------------------
              physint |
                  L1. |   -.203978   .0992982    -2.05   0.040    -.3985989   -.0093571
                      |
             alliance |
                  L1. |   .0904479   .2324982     0.39   0.697    -.3652402     .546136
                      |
     alliance_physint |
                  L1. |   .0986393   .0453442     2.18   0.030     .0097663    .1875124
                      |
   donorallyneighbor2 |
                  L1. |   .7030505   .2361475     2.98   0.003       .24021    1.165891
                      |
allyneighbor2_physint |
                  L1. |  -.0741116   .0371147    -2.00   0.046    -.1468551   -.0013681
                      |
                 s3un |
                  L1. |  -.9201125   .2389928    -3.85   0.000     -1.38853   -.4516951
                      |
         s3un_physint |
                  L1. |   .1578429   .0474648     3.33   0.001     .0648136    .2508721
                      |
           lnreftotal |
                  L1. |   .0372784   .0206704     1.80   0.071    -.0032349    .0777917
                      |
   lnreftotal_physint |
                  L1. |  -.0039177   .0036749    -1.07   0.286    -.0111204     .003285
                      |
            lnnytimes |
                  L1. |    .012658   .0532264     0.24   0.812    -.0916638    .1169797
                      |
    lnnytimes_physint |
                  L1. |  -.0239604   .0095516    -2.51   0.012    -.0426812   -.0052396
                      |
           ratpercent |
                  L1. |  -.3387952   .2092042    -1.62   0.105    -.7488279    .0712376
                      |
   ratpercent_physint |
                  L1. |   .0742352   .0405109     1.83   0.067    -.0051648    .1536351
                      |
        donor_physint |
                  L1. |  -.1094926   .0590383    -1.85   0.064    -.2252056    .0062204
                      |
donor_physint_physint |
                  L1. |   .0111337   .0129569     0.86   0.390    -.0142614    .0365288
                      |
              polity2 |
                  L1. |   .0304733   .0054317     5.61   0.000     .0198274    .0411193
                      |
          lneconaidpc |
                  L1. |   .4421454   .0093382    47.35   0.000     .4238428     .460448
                      |
       lnworldaidecon |   .8471189   .0299221    28.31   0.000     .7884726    .9057652
                      |
             ln_rgdpc |
                  L1. |  -.5812897   .0728046    -7.98   0.000     -.723984   -.4385953
                      |
        ln_population |
                  L1. |   .3560093   .0486467     7.32   0.000     .2606635    .4513552
                      |
             ln_trade |
                  L1. |   .0763158    .009406     8.11   0.000     .0578804    .0947512
                      |
          dyad_colony |    1.45382   .3360895     4.33   0.000     .7950965    2.112543
            socialist |  -.7414806   .1855119    -4.00   0.000    -1.105077   -.3778841
              ColdWar |  -.0150767    .084396    -0.18   0.858    -.1804898    .1503364
           coldwarsoc |   1.033888   .1139265     9.08   0.000     .8105965     1.25718
                      |
      ColdWar_physint |
                  L1. |   .0218749   .0143076     1.53   0.126    -.0061675    .0499173
                      |
                  war |
                  L1. |  -.0646757   .0684618    -0.94   0.345    -.1988584    .0695069
                      |
             post2001 |   .1995948   .0571332     3.49   0.000     .0876157    .3115739
           region_SSA |    .905439   .2186151     4.14   0.000     .4769612    1.333917
         region_Latin |   .5399645   .2177612     2.48   0.013     .1131604    .9667686
          region_MENA |  -.9367404   .2489909    -3.76   0.000    -1.424753   -.4487272
      region_EAsiaPac |   .4662545   .2304579     2.02   0.043     .0145653    .9179436
                _cons |  -16.47174     1.1429   -14.41   0.000    -18.71179    -14.2317
----------------------+----------------------------------------------------------------
             /sigma_u |   2.273309   .0532954    42.65   0.000     2.168851    2.377766
             /sigma_e |   2.896274   .0171213   169.16   0.000     2.862717    2.929832
----------------------+----------------------------------------------------------------
                  rho |   .3812189   .0112803                      .3593148    .4035103
---------------------------------------------------------------------------------------
        24,430  left-censored observations
        17,505     uncensored observations
             0 right-censored observations

. 
. tab year if e(sample)

       year |      Freq.     Percent        Cum.
------------+-----------------------------------
       1983 |      1,614        3.85        3.85
       1984 |      1,633        3.89        7.74
       1985 |      1,652        3.94       11.68
       1986 |      1,652        3.94       15.62
       1987 |      1,633        3.89       19.52
       1988 |      1,652        3.94       23.46
       1989 |      1,652        3.94       27.39
       1990 |      1,709        4.08       31.47
       1991 |      1,652        3.94       35.41
       1992 |      1,669        3.98       39.39
       1993 |      1,651        3.94       43.33
       1994 |      1,965        4.69       48.01
       1995 |      2,000        4.77       52.78
       1996 |      2,006        4.78       57.57
       1997 |      2,026        4.83       62.40
       1998 |      2,281        5.44       67.84
       1999 |      2,239        5.34       73.18
       2000 |      2,236        5.33       78.51
       2001 |      2,264        5.40       83.91
       2002 |      2,239        5.34       89.25
       2003 |      2,264        5.40       94.64
       2004 |      2,246        5.36      100.00
------------+-----------------------------------
      Total |     41,935      100.00

. gen neil_samp = 0

. replace neil_samp = 1 if e(sample)
(41,935 real changes made)

. esttab using table1.csv, csv nogaps replace
(output written to table1.csv)

. 
. unique countryname if e(sample)
Number of unique values of countryname is  113
Number of records is  41935

. estadd scalar countries = r(sum): neilsen

. 
. unique donorname if e(sample)
Number of unique values of donorname is  21
Number of records is  41935

. estadd scalar donors = r(sum): neilsen

. 
. unique dyadnum if e(sample)
Number of unique values of dyadnum is  2364
Number of records is  41935

. estadd scalar dyads= r(sum): neilsen

. 
. * how many countries are condemned in the window of this model?
. unique countryname if e(sample) & PUBRES == 1
Number of unique values of countryname is  24
Number of records is  3007

. 
. * the esarey-demeritt model
. eststo esdem3: xttobit lneconaidpc PUBRES lagXpub l.physint l.alliance allXpub l.donorallyneighbor2 neiXpub l.s3un s3unXpub l.lnreftotal l.lnnytimes l.ratpercent l.don
> or_physint l.polity2 l.lneconaidpc lnworldaidecon l.ln_rgdpc l.ln_population l.ln_trade dyad_colony socialist ColdWar coldwarsoc l.war post2001 region_SSA region_Latin
>  region_MENA region_EAsiaPac if(inmysample==1), ll(0) intpoints(19)

Obtaining starting values for full model:

Iteration 0:   log likelihood = -72995.674
Iteration 1:   log likelihood = -71837.631
Iteration 2:   log likelihood = -71716.603
Iteration 3:   log likelihood = -71714.651
Iteration 4:   log likelihood = -71714.649

Fitting full model:

Iteration 0:   log likelihood = -53500.936  
Iteration 1:   log likelihood = -47383.982  
Iteration 2:   log likelihood = -44824.307  
Iteration 3:   log likelihood = -44545.768  
Iteration 4:   log likelihood = -44484.021  
Iteration 5:   log likelihood = -44483.865  
Iteration 6:   log likelihood = -44483.865  

Random-effects tobit regression                 Number of obs     =     35,234
Group variable: dyadnum                         Number of groups  =      2,088

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          1
                                                              avg =       16.9
                                                              max =         21

Integration method: mvaghermite                 Integration pts.  =         19

                                                Wald chi2(29)     =    4583.96
Log likelihood  = -44483.865                    Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
       lneconaidpc |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
            PUBRES |  -1.629113   .2271507    -7.17   0.000     -2.07432   -1.183906
           lagXpub |   .2489034   .0336479     7.40   0.000     .1829546    .3148522
                   |
           physint |
               L1. |  -.0644292   .0161606    -3.99   0.000    -.0961033   -.0327551
                   |
          alliance |
               L1. |   .3985323   .2063456     1.93   0.053    -.0058978    .8029623
                   |
           allXpub |   .2089894   .6331235     0.33   0.741     -1.03191    1.449889
                   |
donorallyneighbor2 |
               L1. |   -.088609   .2070586    -0.43   0.669    -.4944364    .3172183
                   |
           neiXpub |   .8258539   .2651878     3.11   0.002     .3060954    1.345612
                   |
              s3un |
               L1. |  -.1790268   .1797019    -1.00   0.319     -.531236    .1731824
                   |
          s3unXpub |   1.391859   .4392934     3.17   0.002     .5308596    2.252858
                   |
        lnreftotal |
               L1. |   .0445533   .0133715     3.33   0.001     .0183456    .0707609
                   |
         lnnytimes |
               L1. |  -.0982936   .0321863    -3.05   0.002    -.1613776   -.0352096
                   |
        ratpercent |
               L1. |  -.2997179   .1528433    -1.96   0.050    -.5992853   -.0001505
                   |
     donor_physint |
               L1. |  -.0221594   .0337711    -0.66   0.512    -.0883495    .0440307
                   |
           polity2 |
               L1. |   .0319693   .0059642     5.36   0.000     .0202796    .0436589
                   |
       lneconaidpc |
               L1. |   .3852768   .0104312    36.93   0.000     .3648319    .4057216
                   |
    lnworldaidecon |   .9790695   .0336349    29.11   0.000     .9131463    1.044993
                   |
          ln_rgdpc |
               L1. |  -.3439535   .0841434    -4.09   0.000    -.5088715   -.1790356
                   |
     ln_population |
               L1. |   .4479054   .0559139     8.01   0.000     .3383162    .5574947
                   |
          ln_trade |
               L1. |   .0771006   .0101944     7.56   0.000     .0571199    .0970813
                   |
       dyad_colony |   1.867914   .3713109     5.03   0.000     1.140158     2.59567
         socialist |  -.6229936    .202019    -3.08   0.002    -1.018943   -.2270437
           ColdWar |  -.0405848   .0796741    -0.51   0.610    -.1967431    .1155735
        coldwarsoc |   1.091554    .118998     9.17   0.000     .8583225    1.324786
                   |
               war |
               L1. |  -.0639571   .0759057    -0.84   0.399    -.2127295    .0848153
                   |
          post2001 |    .120315   .0921804     1.31   0.192    -.0603552    .3009852
        region_SSA |    .915184   .2444667     3.74   0.000     .4360381     1.39433
      region_Latin |    .208284   .2514655     0.83   0.408    -.2845793    .7011474
       region_MENA |  -1.568152   .2938213    -5.34   0.000    -2.144032    -.992273
   region_EAsiaPac |   .1412347   .2612104     0.54   0.589    -.3707283    .6531978
             _cons |  -22.28018   1.222166   -18.23   0.000    -24.67558   -19.88478
-------------------+----------------------------------------------------------------
          /sigma_u |   2.476214   .0621114    39.87   0.000     2.354478     2.59795
          /sigma_e |   2.973099   .0192603   154.36   0.000     2.935349    3.010848
-------------------+----------------------------------------------------------------
               rho |   .4095689   .0123842                      .3854844    .4339997
------------------------------------------------------------------------------------
        20,586  left-censored observations
        14,648     uncensored observations
             0 right-censored observations

. 
. tab year if e(sample)

       year |      Freq.     Percent        Cum.
------------+-----------------------------------
       1982 |      1,539        4.37        4.37
       1983 |      1,558        4.42        8.79
       1984 |      1,558        4.42       13.21
       1985 |      1,596        4.53       17.74
       1986 |      1,558        4.42       22.16
       1987 |      1,558        4.42       26.59
       1988 |      1,501        4.26       30.85
       1989 |      1,539        4.37       35.21
       1990 |      1,558        4.42       39.64
       1991 |      1,557        4.42       44.05
       1992 |      1,575        4.47       48.52
       1993 |      1,556        4.42       52.94
       1994 |      1,727        4.90       57.84
       1995 |      1,738        4.93       62.77
       1996 |      1,705        4.84       67.61
       1997 |      1,782        5.06       72.67
       1998 |      1,948        5.53       78.20
       1999 |      1,906        5.41       83.61
       2000 |      1,923        5.46       89.07
       2001 |      1,928        5.47       94.54
       2002 |      1,924        5.46      100.00
------------+-----------------------------------
      Total |     35,234      100.00

. gen ed_samp = 0

. replace ed_samp = 1 if e(sample)
(35,234 real changes made)

. esttab using table3.csv, csv nogaps replace
(output written to table3.csv)

. 
. * how many countries are condemned in the window of this model?
. unique countryname if e(sample) & PUBRES == 1
Number of unique values of countryname is  25
Number of records is  3199

. 
. *Grab necessary elements of the B and VCV matrixes needed to calculate MFX and SEs
. matrix b=e(b)

. mat2txt, matrix(b) saving(xttobit_beta.txt) replace

. 
. matrix V=e(V)

. mat2txt, matrix(V) saving(xttobit_VCV.txt) replace

. 
. 
. unique countryname if e(sample)
Number of unique values of countryname is  100
Number of records is  35234

. estadd scalar countries = r(sum): esdem3

. 
. unique donorname if e(sample)
Number of unique values of donorname is  21
Number of records is  35234

. estadd scalar donors = r(sum): esdem3

. 
. unique dyadnum if e(sample)
Number of unique values of dyadnum is  2088
Number of records is  35234

. estadd scalar dyads= r(sum): esdem3

. 
. 
. * determine average values for marginal effects plots
. summarize PUBRES lagXpub l.physint l.alliance allXpub l.donorallyneighbor2 neiXpub l.s3un s3unXpub l.lnreftotal l.lnnytimes l.ratpercent l.donor_physint l.polity2 l.ln
> econaidpc lnworldaidecon l.ln_rgdpc l.ln_population l.ln_trade dyad_colony socialist ColdWar coldwarsoc l.war post2001 region_SSA region_Latin region_MENA region_EAsia
> Pac if(ed_samp==1)

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
      PUBRES |     35,234     .090793    .2873186          0          1
     lagXpub |     35,234    .1078847    .7830413          0   13.07848
             |
     physint |
         L1. |     35,234    3.880258     2.25795          0          8
             |
    alliance |
         L1. |     35,234    .0584379    .2345729          0          1
             |
     allXpub |     35,234    .0017597     .041912          0          1
-------------+---------------------------------------------------------
             |
donorallyn~2 |
         L1. |     35,234    .1450871    .3521937          0          1
             |
     neiXpub |     35,234    .0359312    .1861213          0          1
             |
        s3un |
         L1. |     35,234    .3926666    .2491912         -1          1
             |
    s3unXpub |     35,234    .0320006    .1213093       -.75   .7948718
             |
  lnreftotal |
         L1. |     35,234     4.00579    3.445647          0   12.42481
-------------+---------------------------------------------------------
             |
   lnnytimes |
         L1. |     35,234    1.257437    1.224318          0   5.793014
             |
  ratpercent |
         L1. |     35,234    .7319112    .3171054          0          1
             |
do~r_physint |
         L1. |     35,234    7.442243    .7673289          4          8
             |
     polity2 |
         L1. |     35,234   -.5143044    6.818185        -10         10
             |
 lneconaidpc |
         L1. |     35,234    2.117417    3.004659          0   13.07848
-------------+---------------------------------------------------------
             |
lnworldaid~n |     35,234    15.93863    8.469561          0   23.75916
             |
    ln_rgdpc |
         L1. |     35,234    7.850649    .9313135   5.231002   10.69319
             |
ln_populat~n |
         L1. |     35,234    9.193985    1.432921   6.540539   14.05538
             |
    ln_trade |
         L1. |     35,234    15.96552    4.638527          0   25.19934
             |
 dyad_colony |     35,234    .0403304    .1967357          0          1
-------------+---------------------------------------------------------
   socialist |     35,234    .2405063     .427397          0          1
     ColdWar |     35,234    .5594596     .496459          0          1
  coldwarsoc |     35,234    .1601862    .3667838          0          1
             |
         war |
         L1. |     35,234    .2666459    .4422119          0          1
             |
    post2001 |     35,234    .0546063    .2272135          0          1
-------------+---------------------------------------------------------
  region_SSA |     35,234    .3954135    .4889463          0          1
region_Latin |     35,234    .2310268    .4214955          0          1
 region_MENA |     35,234    .1224386    .3277963          0          1
region_EAs~c |     35,234    .1254186    .3311977          0          1

. 
. 
. tab ed_samp neil_samp

           |       neil_samp
   ed_samp |         0          1 |     Total
-----------+----------------------+----------
         0 |    76,198      8,625 |    84,823 
         1 |     1,924     33,310 |    35,234 
-----------+----------------------+----------
     Total |    78,122     41,935 |   120,057 


. 
. gen comm_samp = 0

. replace comm_samp=1 if neil_samp==1 & ed_samp==1
(33,310 real changes made)

. 
. tab ed_samp comm_samp

           |       comm_samp
   ed_samp |         0          1 |     Total
-----------+----------------------+----------
         0 |    84,823          0 |    84,823 
         1 |     1,924     33,310 |    35,234 
-----------+----------------------+----------
     Total |    86,747     33,310 |   120,057 


. tab neil_samp comm_samp

           |       comm_samp
 neil_samp |         0          1 |     Total
-----------+----------------------+----------
         0 |    78,122          0 |    78,122 
         1 |     8,625     33,310 |    41,935 
-----------+----------------------+----------
     Total |    86,747     33,310 |   120,057 


. 
. keep dyadnum year comm_samp neil_samp ed_samp

. save common_sample.dta, replace
file common_sample.dta saved

. 
. 
. 
. 
. 
. ** merge in public resolution data
. use jprworkdatanew.dta, clear

. rename YEAR year 

. rename CCODE countrynumcode_g

. save jpr_merge.dta, replace
file jpr_merge.dta saved

. 
. use "dat2.dta", clear

. 
. merge m:1 year countrynumcode_g year using jpr_merge.dta

    Result                           # of obs.
    -----------------------------------------
    not matched                        51,079
        from master                    50,316  (_merge==1)
        from using                        763  (_merge==2)

    matched                            69,741  (_merge==3)
    -----------------------------------------

. drop if _merge==2
(763 observations deleted)

. 
. tsset dyadnum year
       panel variable:  dyadnum (unbalanced)
        time variable:  year, 1980 to 2006, but with gaps
                delta:  1 unit

. 
. gen allXpub = PUBRES*l.alliance
(66,759 missing values generated)

. gen neiXpub = PUBRES*l.donorallyneighbor2
(66,633 missing values generated)

. gen s3unXpub = PUBRES*l.s3un
(66,693 missing values generated)

. 
. gen lagXpub = PUBRES*l.lneconaidpc
(66,864 missing values generated)

. 
. 
. * calculate common sample AIC/BIC of the neilsen model
. drop _merge

. merge m:1 dyadnum year using common_sample.dta

    Result                           # of obs.
    -----------------------------------------
    not matched                             0
    matched                           120,057  (_merge==3)
    -----------------------------------------

. tsset dyadnum year
       panel variable:  dyadnum (unbalanced)
        time variable:  year, 1980 to 2006, but with gaps
                delta:  1 unit

. xttobit lneconaidpc l.physint l.alliance l.alliance_physint l.donorallyneighbor2 l.allyneighbor2_physint l.s3un l.s3un_physint l.lnreftotal l.lnreftotal_physint l.lnny
> times l.lnnytimes_physint l.ratpercent l.ratpercent_physint l.donor_physint l.donor_physint_physint l.polity2 l.lneconaidpc lnworldaidecon l.ln_rgdpc l.ln_population l
> .ln_trade dyad_colony socialist ColdWar coldwarsoc l.ColdWar_physint l.war post2001 region_SSA region_Latin region_MENA region_EAsiaPac if(comm_samp==1), ll(0) intpoin
> ts(20)

Obtaining starting values for full model:

Iteration 0:   log likelihood = -68887.379
Iteration 1:   log likelihood = -67903.716
Iteration 2:   log likelihood = -67734.962
Iteration 3:   log likelihood = -67729.824
Iteration 4:   log likelihood =  -67729.81

Fitting full model:

Iteration 0:   log likelihood = -50894.067  
Iteration 1:   log likelihood = -45311.131  
Iteration 2:   log likelihood =  -42798.61  
Iteration 3:   log likelihood = -42540.091  
Iteration 4:   log likelihood = -42486.517  
Iteration 5:   log likelihood = -42486.397  
Iteration 6:   log likelihood = -42486.397  

Random-effects tobit regression                 Number of obs     =     33,310
Group variable: dyadnum                         Number of groups  =      2,086

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          2
                                                              avg =       16.0
                                                              max =         20

Integration method: mvaghermite                 Integration pts.  =         20

                                                Wald chi2(32)     =    4282.70
Log likelihood  = -42486.397                    Prob > chi2       =     0.0000

---------------------------------------------------------------------------------------
          lneconaidpc |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
----------------------+----------------------------------------------------------------
              physint |
                  L1. |  -.1949555   .1109578    -1.76   0.079    -.4124287    .0225177
                      |
             alliance |
                  L1. |   .1078028   .2916397     0.37   0.712    -.4638006    .6794062
                      |
     alliance_physint |
                  L1. |   .0986578   .0577575     1.71   0.088    -.0145447    .2118604
                      |
   donorallyneighbor2 |
                  L1. |    .500858   .2649865     1.89   0.059    -.0185061    1.020222
                      |
allyneighbor2_physint |
                  L1. |  -.1034338   .0416181    -2.49   0.013    -.1850038   -.0218637
                      |
                 s3un |
                  L1. |  -.9005321   .2781694    -3.24   0.001    -1.445734     -.35533
                      |
         s3un_physint |
                  L1. |   .2045323   .0542642     3.77   0.000     .0981765    .3108881
                      |
           lnreftotal |
                  L1. |   .0862145   .0241456     3.57   0.000     .0388899     .133539
                      |
   lnreftotal_physint |
                  L1. |  -.0110839   .0042151    -2.63   0.009    -.0193453   -.0028224
                      |
            lnnytimes |
                  L1. |   .0169896   .0608107     0.28   0.780    -.1021972    .1361765
                      |
    lnnytimes_physint |
                  L1. |  -.0297497   .0106776    -2.79   0.005    -.0506774   -.0088221
                      |
           ratpercent |
                  L1. |  -.6710852   .2338043    -2.87   0.004    -1.129333   -.2128372
                      |
   ratpercent_physint |
                  L1. |   .0926385    .044642     2.08   0.038     .0051418    .1801351
                      |
        donor_physint |
                  L1. |  -.0683572   .0665274    -1.03   0.304    -.1987486    .0620341
                      |
donor_physint_physint |
                  L1. |   .0112226    .014436     0.78   0.437    -.0170714    .0395166
                      |
              polity2 |
                  L1. |   .0367181   .0060531     6.07   0.000     .0248543    .0485818
                      |
          lneconaidpc |
                  L1. |   .4035169   .0104562    38.59   0.000     .3830232    .4240107
                      |
       lnworldaidecon |   .9529625    .033926    28.09   0.000     .8864687    1.019456
                      |
             ln_rgdpc |
                  L1. |    -.33036   .0854859    -3.86   0.000    -.4979093   -.1628106
                      |
        ln_population |
                  L1. |   .4374393   .0554285     7.89   0.000     .3288015    .5460771
                      |
             ln_trade |
                  L1. |   .0741659   .0103719     7.15   0.000     .0538372    .0944945
                      |
          dyad_colony |   1.815757   .3641036     4.99   0.000     1.102127    2.529387
            socialist |  -.5410763   .2013427    -2.69   0.007    -.9357008   -.1464518
              ColdWar |  -.1320944    .091773    -1.44   0.150    -.3119662    .0477774
           coldwarsoc |   1.030869   .1225022     8.42   0.000     .7907694    1.270969
                      |
      ColdWar_physint |
                  L1. |   .0225762   .0157471     1.43   0.152    -.0082876    .0534399
                      |
                  war |
                  L1. |   -.086184    .077219    -1.12   0.264    -.2375305    .0651625
                      |
             post2001 |   .0836225   .0918763     0.91   0.363    -.0964517    .2636967
           region_SSA |   .9218015   .2412784     3.82   0.000     .4489046    1.394698
         region_Latin |   .1860287   .2476332     0.75   0.453    -.2993234    .6713809
          region_MENA |  -1.463793   .2906591    -5.04   0.000    -2.033474   -.8941114
      region_EAsiaPac |   .1321081   .2569087     0.51   0.607    -.3714238      .63564
                _cons |  -21.17624   1.308144   -16.19   0.000    -23.74015   -18.61232
----------------------+----------------------------------------------------------------
             /sigma_u |   2.416686    .061841    39.08   0.000      2.29548    2.537892
             /sigma_e |   2.931175   .0193728   151.30   0.000     2.893205    2.969145
----------------------+----------------------------------------------------------------
                  rho |   .4046776   .0126176                      .3801536    .4295819
---------------------------------------------------------------------------------------
        19,219  left-censored observations
        14,091     uncensored observations
             0 right-censored observations

. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |     33,310         .   -42486.4      35    85042.79   85337.27
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. mat icsto = r(S)

. scalar aicsto = icsto[1,5]

. scalar bicsto = icsto[1,6]

. estadd scalar AIC = aicsto: neilsen

. estadd scalar BIC = bicsto: neilsen

. 
. * compare to version 9 results
. version 9

. xttobit lneconaidpc l.physint l.alliance l.alliance_physint l.donorallyneighbor2 l.allyneighbor2_physint l.s3un l.s3un_physint l.lnreftotal l.lnreftotal_physint l.lnny
> times l.lnnytimes_physint l.ratpercent l.ratpercent_physint l.donor_physint l.donor_physint_physint l.polity2 l.lneconaidpc lnworldaidecon l.ln_rgdpc l.ln_population l
> .ln_trade dyad_colony socialist ColdWar coldwarsoc l.ColdWar_physint l.war post2001 region_SSA region_Latin region_MENA region_EAsiaPac if(inmysample==1), ll(0) intpoi
> nts(20)

Obtaining starting values for full model:

Iteration 0:   log likelihood = -85542.325
Iteration 1:   log likelihood = -84268.758
Iteration 2:   log likelihood = -84152.161
Iteration 3:   log likelihood = -84150.536
Iteration 4:   log likelihood = -84150.534

Fitting full model:

Iteration 0:   log likelihood = -63223.836  
Iteration 1:   log likelihood = -56364.109  
Iteration 2:   log likelihood = -52877.532  
Iteration 3:   log likelihood = -52578.596  
Iteration 4:   log likelihood = -52521.445  
Iteration 5:   log likelihood = -52521.384  
Iteration 6:   log likelihood = -52521.384  

Random-effects tobit regression                 Number of obs     =     41,935
Group variable: dyadnum                         Number of groups  =      2,364

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          1
                                                              avg =       17.7
                                                              max =         22

Integration method: aghermite                   Integration pts.  =         20

                                                Wald chi2(32)     =    5824.83
Log likelihood  = -52521.384                    Prob > chi2       =     0.0000

---------------------------------------------------------------------------------------
          lneconaidpc |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
----------------------+----------------------------------------------------------------
              physint |
                  L1. |  -.1966009   .0984891    -2.00   0.046     -.389636   -.0035658
                      |
             alliance |
                  L1. |   .0491073    .218541     0.22   0.822    -.3792252    .4774399
                      |
     alliance_physint |
                  L1. |   .0946653   .0442083     2.14   0.032     .0080187    .1813119
                      |
   donorallyneighbor2 |
                  L1. |   .6679489   .2182073     3.06   0.002     .2402704    1.095627
                      |
allyneighbor2_physint |
                  L1. |  -.0789779   .0361528    -2.18   0.029    -.1498361   -.0081197
                      |
                 s3un |
                  L1. |  -.9340544   .2327366    -4.01   0.000     -1.39021   -.4778989
                      |
         s3un_physint |
                  L1. |   .1637799   .0467288     3.50   0.000      .072193    .2553667
                      |
           lnreftotal |
                  L1. |   .0375874   .0202456     1.86   0.063    -.0020934    .0772681
                      |
   lnreftotal_physint |
                  L1. |  -.0038664   .0036221    -1.07   0.286    -.0109655    .0032326
                      |
            lnnytimes |
                  L1. |   .0163887   .0526683     0.31   0.756    -.0868393    .1196167
                      |
    lnnytimes_physint |
                  L1. |  -.0241399   .0094487    -2.55   0.011    -.0426591   -.0056207
                      |
           ratpercent |
                  L1. |  -.2717254   .2014856    -1.35   0.177    -.6666299     .123179
                      |
   ratpercent_physint |
                  L1. |   .0703148   .0398779     1.76   0.078    -.0078445     .148474
                      |
        donor_physint |
                  L1. |  -.1042935   .0585771    -1.78   0.075    -.2191024    .0105155
                      |
donor_physint_physint |
                  L1. |   .0105474   .0128693     0.82   0.412     -.014676    .0357707
                      |
              polity2 |
                  L1. |   .0321075   .0052974     6.06   0.000     .0217248    .0424903
                      |
          lneconaidpc |
                  L1. |   .4504702   .0090978    49.51   0.000     .4326389    .4683016
                      |
       lnworldaidecon |   .8033995    .027704    29.00   0.000     .7491007    .8576982
                      |
             ln_rgdpc |
                  L1. |  -.5756093   .0665841    -8.64   0.000    -.7061118   -.4451068
                      |
        ln_population |
                  L1. |    .313516   .0432822     7.24   0.000     .2286845    .3983474
                      |
             ln_trade |
                  L1. |    .074017   .0090983     8.14   0.000     .0561846    .0918494
                      |
          dyad_colony |   1.352763   .3146047     4.30   0.000     .7361491    1.969377
            socialist |  -.6958113    .157112    -4.43   0.000    -1.003745   -.3878773
              ColdWar |  -.0088678    .083452    -0.11   0.915    -.1724308    .1546952
           coldwarsoc |    1.01183   .1130692     8.95   0.000     .7902184    1.233441
                      |
      ColdWar_physint |
                  L1. |   .0204868   .0142101     1.44   0.149    -.0073645    .0483381
                      |
                  war |
                  L1. |  -.0606608    .067568    -0.90   0.369    -.1930916    .0717699
                      |
             post2001 |   .2092769   .0566441     3.69   0.000     .0982566    .3202973
           region_SSA |   .8721822   .1878035     4.64   0.000     .5040942     1.24027
         region_Latin |    .587781   .1842523     3.19   0.001      .226653    .9489089
          region_MENA |  -.6779352   .2068324    -3.28   0.001    -1.083319   -.2725511
      region_EAsiaPac |   .4885885   .1994212     2.45   0.014     .0977301    .8794469
                _cons |  -15.22536    1.05239   -14.47   0.000      -17.288   -13.16271
----------------------+----------------------------------------------------------------
             /sigma_u |   2.205737   .0509511    43.29   0.000     2.105875    2.305599
             /sigma_e |   2.890609   .0170098   169.94   0.000     2.857271    2.923948
----------------------+----------------------------------------------------------------
                  rho |   .3679988   .0110156                      .3466274    .3897869
---------------------------------------------------------------------------------------
        24,430  left-censored observations
        17,505     uncensored observations
             0 right-censored observations

. version 14.1

. 
. 
. * calculate common sample AIC/BIC of the esarey-demeritt model
. xttobit lneconaidpc PUBRES lagXpub l.physint l.alliance allXpub l.donorallyneighbor2 neiXpub l.s3un s3unXpub l.lnreftotal l.lnnytimes l.ratpercent l.donor_physint l.po
> lity2 l.lneconaidpc lnworldaidecon l.ln_rgdpc l.ln_population l.ln_trade dyad_colony socialist ColdWar coldwarsoc l.war post2001 region_SSA region_Latin region_MENA re
> gion_EAsiaPac if(comm_samp==1), ll(0) intpoints(20)

Obtaining starting values for full model:

Iteration 0:   log likelihood = -68907.927
Iteration 1:   log likelihood = -67924.809
Iteration 2:   log likelihood = -67745.668
Iteration 3:   log likelihood = -67739.851
Iteration 4:   log likelihood = -67739.835

Fitting full model:

Iteration 0:   log likelihood = -50890.005  
Iteration 1:   log likelihood = -45269.785  
Iteration 2:   log likelihood = -42783.191  
Iteration 3:   log likelihood = -42530.131  
Iteration 4:   log likelihood = -42481.972  
Iteration 5:   log likelihood =  -42481.88  
Iteration 6:   log likelihood =  -42481.88  

Random-effects tobit regression                 Number of obs     =     33,310
Group variable: dyadnum                         Number of groups  =      2,086

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          2
                                                              avg =       16.0
                                                              max =         20

Integration method: mvaghermite                 Integration pts.  =         20

                                                Wald chi2(29)     =    4271.08
Log likelihood  =  -42481.88                    Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
       lneconaidpc |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
            PUBRES |   -1.54371   .2310587    -6.68   0.000    -1.996576   -1.090843
           lagXpub |   .2344118   .0340653     6.88   0.000     .1676451    .3011786
                   |
           physint |
               L1. |  -.0532063    .016516    -3.22   0.001     -.085577   -.0208356
                   |
          alliance |
               L1. |   .4235822   .2079768     2.04   0.042     .0159553    .8312092
                   |
           allXpub |   .2305548   .6452561     0.36   0.721    -1.034124    1.495233
                   |
donorallyneighbor2 |
               L1. |   .0024641   .2074341     0.01   0.991    -.4040992    .4090274
                   |
           neiXpub |   .7264255   .2710039     2.68   0.007     .1952675    1.257583
                   |
              s3un |
               L1. |  -.1815531   .1805022    -1.01   0.315    -.5353308    .1722246
                   |
          s3unXpub |   1.347752   .4457949     3.02   0.003     .4740103    2.221494
                   |
        lnreftotal |
               L1. |   .0434484   .0135029     3.22   0.001     .0169832    .0699136
                   |
         lnnytimes |
               L1. |  -.1067816   .0324055    -3.30   0.001    -.1702953   -.0432679
                   |
        ratpercent |
               L1. |  -.2935771   .1536135    -1.91   0.056     -.594654    .0074998
                   |
     donor_physint |
               L1. |  -.0261846     .03378    -0.78   0.438    -.0923923    .0400231
                   |
           polity2 |
               L1. |   .0342626   .0060678     5.65   0.000     .0223699    .0461554
                   |
       lneconaidpc |
               L1. |   .3884184   .0106556    36.45   0.000     .3675338    .4093031
                   |
    lnworldaidecon |   .9543388   .0338917    28.16   0.000     .8879124    1.020765
                   |
          ln_rgdpc |
               L1. |  -.3586073   .0857215    -4.18   0.000    -.5266183   -.1905963
                   |
     ln_population |
               L1. |   .4378521   .0555973     7.88   0.000     .3288834    .5468208
                   |
          ln_trade |
               L1. |   .0731955   .0103806     7.05   0.000       .05285     .093541
                   |
       dyad_colony |   1.836985   .3656679     5.02   0.000     1.120289    2.553681
         socialist |  -.6409938   .2018373    -3.18   0.001    -1.036588      -.2454
           ColdWar |  -.0591531   .0795167    -0.74   0.457     -.215003    .0966969
        coldwarsoc |   1.116763    .122169     9.14   0.000     .8773159     1.35621
                   |
               war |
               L1. |   -.059509   .0773825    -0.77   0.442     -.211176     .092158
                   |
          post2001 |   .0824376   .0914311     0.90   0.367     -.096764    .2616392
        region_SSA |   .9268858   .2419207     3.83   0.000       .45273    1.401042
      region_Latin |   .2613314   .2479508     1.05   0.292    -.2246431     .747306
       region_MENA |  -1.509705   .2922566    -5.17   0.000    -2.082517   -.9368922
   region_EAsiaPac |   .1734769   .2577888     0.67   0.501    -.3317798    .6787337
             _cons |  -21.49338   1.234481   -17.41   0.000    -23.91292   -19.07384
-------------------+----------------------------------------------------------------
          /sigma_u |   2.428637   .0618638    39.26   0.000     2.307386    2.549888
          /sigma_e |   2.929632   .0193554   151.36   0.000     2.891696    2.967568
-------------------+----------------------------------------------------------------
               rho |   .4073109    .012582                      .3828498     .432139
------------------------------------------------------------------------------------
        19,219  left-censored observations
        14,091     uncensored observations
             0 right-censored observations

. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |     33,310         .  -42481.88      32    85027.76   85296.99
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. mat icsto = r(S)

. scalar aicsto = icsto[1,5]

. scalar bicsto = icsto[1,6]

. estadd scalar AIC = aicsto: esdem3

. estadd scalar BIC = bicsto: esdem3

. 
. 
. * compare to version 9 results
. version 9

. xttobit lneconaidpc PUBRES lagXpub l.physint l.alliance allXpub l.donorallyneighbor2 neiXpub l.s3un s3unXpub l.lnreftotal l.lnnytimes l.ratpercent l.donor_physint l.po
> lity2 l.lneconaidpc lnworldaidecon l.ln_rgdpc l.ln_population l.ln_trade dyad_colony socialist ColdWar coldwarsoc l.war post2001 region_SSA region_Latin region_MENA re
> gion_EAsiaPac if(inmysample==1), ll(0) intpoints(19)

Obtaining starting values for full model:

Iteration 0:   log likelihood = -72995.674
Iteration 1:   log likelihood = -71837.631
Iteration 2:   log likelihood = -71716.603
Iteration 3:   log likelihood = -71714.651
Iteration 4:   log likelihood = -71714.649

Fitting full model:

Iteration 0:   log likelihood = -53500.829  
Iteration 1:   log likelihood =  -47376.19  
Iteration 2:   log likelihood = -44832.555  
Iteration 3:   log likelihood = -44572.293  
Iteration 4:   log likelihood = -44517.226  
Iteration 5:   log likelihood = -44517.166  
Iteration 6:   log likelihood = -44517.166  

Random-effects tobit regression                 Number of obs     =     35,234
Group variable: dyadnum                         Number of groups  =      2,088

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          1
                                                              avg =       16.9
                                                              max =         21

Integration method: aghermite                   Integration pts.  =         19

                                                Wald chi2(29)     =    4974.64
Log likelihood  = -44517.166                    Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
       lneconaidpc |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
            PUBRES |  -1.632848   .2245361    -7.27   0.000    -2.072931   -1.192765
           lagXpub |   .2461822   .0332478     7.40   0.000     .1810177    .3113467
                   |
           physint |
               L1. |  -.0627272   .0159708    -3.93   0.000    -.0940293   -.0314251
                   |
          alliance |
               L1. |   .3210515     .18743     1.71   0.087    -.0463045    .6884075
                   |
           allXpub |   .2617858   .6268011     0.42   0.676    -.9667218    1.490293
                   |
donorallyneighbor2 |
               L1. |  -.0863164   .1765224    -0.49   0.625    -.4322941    .2596612
                   |
           neiXpub |   .7320493   .2522622     2.90   0.004     .2376244    1.226474
                   |
              s3un |
               L1. |  -.1530958   .1736588    -0.88   0.378    -.4934609    .1872693
                   |
          s3unXpub |   1.416418   .4337884     3.27   0.001     .5662083    2.266628
                   |
        lnreftotal |
               L1. |    .045499   .0129682     3.51   0.000     .0200817    .0709163
                   |
         lnnytimes |
               L1. |  -.0938379   .0315735    -2.97   0.003    -.1557208    -.031955
                   |
        ratpercent |
               L1. |  -.2227451     .14033    -1.59   0.112    -.4977869    .0522967
                   |
     donor_physint |
               L1. |  -.0169739   .0334262    -0.51   0.612    -.0824881    .0485403
                   |
           polity2 |
               L1. |   .0338066   .0057875     5.84   0.000     .0224633    .0451499
                   |
       lneconaidpc |
               L1. |   .3980834   .0101107    39.37   0.000     .3782668       .4179
                   |
    lnworldaidecon |   .9171755   .0306407    29.93   0.000     .8571209    .9772301
                   |
          ln_rgdpc |
               L1. |    -.36253   .0756546    -4.79   0.000    -.5108104   -.2142497
                   |
     ln_population |
               L1. |   .3779416   .0464335     8.14   0.000     .2869336    .4689496
                   |
          ln_trade |
               L1. |     .07518   .0098189     7.66   0.000     .0559354    .0944246
                   |
       dyad_colony |   1.719552   .3474907     4.95   0.000     1.038483    2.400622
         socialist |   -.571016   .1635238    -3.49   0.000    -.8915167   -.2505153
           ColdWar |  -.0318225   .0780868    -0.41   0.684    -.1848698    .1212248
        coldwarsoc |   1.059457   .1177946     8.99   0.000     .8285841    1.290331
                   |
               war |
               L1. |  -.0614135   .0744044    -0.83   0.409    -.2072435    .0844164
                   |
          post2001 |   .1240558    .091518     1.36   0.175    -.0553161    .3034277
        region_SSA |   .8869525   .2008945     4.42   0.000     .4932066    1.280698
      region_Latin |   .3175182   .2025901     1.57   0.117    -.0795512    .7145875
       region_MENA |  -1.100527   .2345248    -4.69   0.000    -1.560187   -.6408668
   region_EAsiaPac |   .2294761    .214354     1.07   0.284      -.19065    .6496023
             _cons |  -20.25648   1.071267   -18.91   0.000    -22.35613   -18.15684
-------------------+----------------------------------------------------------------
          /sigma_u |   2.371522   .0582419    40.72   0.000     2.257369    2.485674
          /sigma_e |   2.965967   .0191155   155.16   0.000     2.928501    3.003432
-------------------+----------------------------------------------------------------
               rho |   .3899928   .0120048                      .3666789    .4137094
------------------------------------------------------------------------------------
        20,586  left-censored observations
        14,648     uncensored observations
             0 right-censored observations

. version 14.1

. 
. gen l_lneconaidpc = L.lneconaidpc
(35,910 missing values generated)

. keep if e(sample)
(84,823 observations deleted)

. saveold neilsen_3_R_figure_data.dta, version(12) replace
(saving in Stata 12 format, which can be read by Stata 11 or 12)
file neilsen_3_R_figure_data.dta saved

. 
. 
. ***
. * remove all the physint interactions and add PUBRES interactions
. ***
. 
. ** merge in public resolution data
. use jprworkdatanew.dta, clear

. rename YEAR year 

. rename CCODE countrynumcode_g

. save jpr_merge.dta, replace
file jpr_merge.dta saved

. 
. use "dat2.dta", clear

. 
. merge m:1 year countrynumcode_g year using jpr_merge.dta

    Result                           # of obs.
    -----------------------------------------
    not matched                        51,079
        from master                    50,316  (_merge==1)
        from using                        763  (_merge==2)

    matched                            69,741  (_merge==3)
    -----------------------------------------

. drop if _merge==2
(763 observations deleted)

. 
. tsset dyadnum year
       panel variable:  dyadnum (unbalanced)
        time variable:  year, 1980 to 2006, but with gaps
                delta:  1 unit

. 
. gen allXpub = PUBRES*l.alliance
(66,759 missing values generated)

. gen neiXpub = PUBRES*l.donorallyneighbor2
(66,633 missing values generated)

. gen s3unXpub = PUBRES*l.s3un
(66,693 missing values generated)

. 
. gen lagXpub = PUBRES*l.lneconaidpc
(66,864 missing values generated)

. 
. 
. eststo neilsen2: xttobit lneconaidpc PUBRES l.physint l.alliance allXpub l.donorallyneighbor2 neiXpub l.s3un s3unXpub l.lnreftotal l.lnnytimes l.ratpercent l.donor_phy
> sint l.polity2 l.lneconaidpc lnworldaidecon l.ln_rgdpc l.ln_population l.ln_trade dyad_colony socialist ColdWar coldwarsoc l.war post2001 region_SSA region_Latin regio
> n_MENA region_EAsiaPac if inmysample==1, ll(0) intpoints(19)

Obtaining starting values for full model:

Iteration 0:   log likelihood =  -73004.91
Iteration 1:   log likelihood = -71852.173
Iteration 2:   log likelihood = -71733.041
Iteration 3:   log likelihood = -71731.147
Iteration 4:   log likelihood = -71731.145

Fitting full model:

Iteration 0:   log likelihood = -53526.375  
Iteration 1:   log likelihood = -47414.431  
Iteration 2:   log likelihood = -44851.333  
Iteration 3:   log likelihood = -44573.189  
Iteration 4:   log likelihood = -44511.475  
Iteration 5:   log likelihood = -44511.317  
Iteration 6:   log likelihood = -44511.317  

Random-effects tobit regression                 Number of obs     =     35,234
Group variable: dyadnum                         Number of groups  =      2,088

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          1
                                                              avg =       16.9
                                                              max =         21

Integration method: mvaghermite                 Integration pts.  =         19

                                                Wald chi2(28)     =    4536.21
Log likelihood  = -44511.317                    Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
       lneconaidpc |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
            PUBRES |  -.9970524   .2090064    -4.77   0.000    -1.406697   -.5874075
                   |
           physint |
               L1. |  -.0638761   .0161773    -3.95   0.000    -.0955831   -.0321691
                   |
          alliance |
               L1. |   .3533077   .2065977     1.71   0.087    -.0516163    .7582318
                   |
           allXpub |   1.181425   .6151903     1.92   0.055    -.0243254    2.387176
                   |
donorallyneighbor2 |
               L1. |  -.1196904   .2074731    -0.58   0.564    -.5263302    .2869494
                   |
           neiXpub |   .8225332   .2651692     3.10   0.002     .3028112    1.342255
                   |
              s3un |
               L1. |  -.1588992   .1799729    -0.88   0.377    -.5116395    .1938412
                   |
          s3unXpub |   1.158248   .4355042     2.66   0.008     .3046756    2.011821
                   |
        lnreftotal |
               L1. |   .0431342   .0133741     3.23   0.001     .0169216    .0693469
                   |
         lnnytimes |
               L1. |  -.1004267   .0322123    -3.12   0.002    -.1635617   -.0372917
                   |
        ratpercent |
               L1. |  -.2964993   .1530266    -1.94   0.053     -.596426    .0034273
                   |
     donor_physint |
               L1. |  -.0195498   .0338008    -0.58   0.563     -.085798    .0466985
                   |
           polity2 |
               L1. |   .0324752   .0059673     5.44   0.000     .0207796    .0441709
                   |
       lneconaidpc |
               L1. |   .4006907   .0102434    39.12   0.000     .3806141    .4207674
                   |
    lnworldaidecon |   .9777137   .0336745    29.03   0.000     .9117128    1.043715
                   |
          ln_rgdpc |
               L1. |  -.3466634   .0842277    -4.12   0.000    -.5117468   -.1815801
                   |
     ln_population |
               L1. |   .4425288   .0559944     7.90   0.000     .3327818    .5522759
                   |
          ln_trade |
               L1. |   .0782922   .0101996     7.68   0.000     .0583013     .098283
                   |
       dyad_colony |   1.875727   .3719617     5.04   0.000     1.146695    2.604758
         socialist |  -.6035783   .2023663    -2.98   0.003    -1.000209   -.2069477
           ColdWar |  -.0298653    .079737    -0.37   0.708     -.186147    .1264163
        coldwarsoc |   1.067224   .1190509     8.96   0.000     .8338881    1.300559
                   |
               war |
               L1. |  -.0791455   .0759346    -1.04   0.297    -.2279745    .0696836
                   |
          post2001 |   .1264784   .0922604     1.37   0.170    -.0543487    .3073054
        region_SSA |   .8756419   .2448336     3.58   0.000     .3957769    1.355507
      region_Latin |   .1761954   .2518746     0.70   0.484    -.3174697    .6698605
       region_MENA |  -1.592296   .2942731    -5.41   0.000    -2.169061   -1.015531
   region_EAsiaPac |   .1191514   .2616916     0.46   0.649    -.3937547    .6320575
             _cons |   -22.2485   1.223627   -18.18   0.000    -24.64676   -19.85024
-------------------+----------------------------------------------------------------
          /sigma_u |   2.481343   .0622983    39.83   0.000     2.359241    2.603446
          /sigma_e |   2.976396   .0192843   154.34   0.000     2.938599    3.014192
-------------------+----------------------------------------------------------------
               rho |   .4100337   .0123996                      .3859185     .434494
------------------------------------------------------------------------------------
        20,586  left-censored observations
        14,648     uncensored observations
             0 right-censored observations

. 
. esttab using table2.csv, csv nogaps replace
(output written to table2.csv)

. 
. unique countryname if e(sample)
Number of unique values of countryname is  100
Number of records is  35234

. estadd scalar countries = r(sum): neilsen2

. 
. unique donorname if e(sample)
Number of unique values of donorname is  21
Number of records is  35234

. estadd scalar donors = r(sum): neilsen2

. 
. unique dyadnum if e(sample)
Number of unique values of dyadnum is  2088
Number of records is  35234

. estadd scalar dyads= r(sum): neilsen2

. 
. * how many countries are condemned in the window of this model?
. unique countryname if e(sample) & PUBRES == 1
Number of unique values of countryname is  25
Number of records is  3199

. 
. 
. * calculate common sample AIC/BIC of this model
. drop _merge

. merge m:1 dyadnum year using common_sample.dta

    Result                           # of obs.
    -----------------------------------------
    not matched                             0
    matched                           120,057  (_merge==3)
    -----------------------------------------

. tsset dyadnum year
       panel variable:  dyadnum (unbalanced)
        time variable:  year, 1980 to 2006, but with gaps
                delta:  1 unit

. 
. xttobit lneconaidpc PUBRES l.physint l.alliance allXpub l.donorallyneighbor2 neiXpub l.s3un s3unXpub l.lnreftotal l.lnnytimes l.ratpercent l.donor_physint l.polity2 l.
> lneconaidpc lnworldaidecon l.ln_rgdpc l.ln_population l.ln_trade dyad_colony socialist ColdWar coldwarsoc l.war post2001 region_SSA region_Latin region_MENA region_EAs
> iaPac if(comm_samp==1), ll(0) intpoints(20)

Obtaining starting values for full model:

Iteration 0:   log likelihood = -68915.758
Iteration 1:   log likelihood = -67934.624
Iteration 2:   log likelihood = -67759.031
Iteration 3:   log likelihood = -67753.422
Iteration 4:   log likelihood = -67753.407

Fitting full model:

Iteration 0:   log likelihood = -50911.077  
Iteration 1:   log likelihood = -45294.585  
Iteration 2:   log likelihood = -42805.711  
Iteration 3:   log likelihood = -42553.419  
Iteration 4:   log likelihood = -42505.724  
Iteration 5:   log likelihood = -42505.632  
Iteration 6:   log likelihood = -42505.632  

Random-effects tobit regression                 Number of obs     =     33,310
Group variable: dyadnum                         Number of groups  =      2,086

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          2
                                                              avg =       16.0
                                                              max =         20

Integration method: mvaghermite                 Integration pts.  =         20

                                                Wald chi2(28)     =    4227.98
Log likelihood  = -42505.632                    Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
       lneconaidpc |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
            PUBRES |  -.9456182   .2126828    -4.45   0.000    -1.362469   -.5287675
                   |
           physint |
               L1. |  -.0525358   .0165307    -3.18   0.001    -.0849354   -.0201362
                   |
          alliance |
               L1. |   .3803216   .2082353     1.83   0.068     -.027812    .7884552
                   |
           allXpub |   1.138804   .6270266     1.82   0.069    -.0901456    2.367754
                   |
donorallyneighbor2 |
               L1. |  -.0270915    .207848    -0.13   0.896    -.4344662    .3802831
                   |
           neiXpub |   .7081789   .2708872     2.61   0.009     .1772497    1.239108
                   |
              s3un |
               L1. |  -.1625985   .1807634    -0.90   0.368    -.5168883    .1916913
                   |
          s3unXpub |   1.141267   .4421869     2.58   0.010     .2745965    2.007937
                   |
        lnreftotal |
               L1. |   .0419881   .0135053     3.11   0.002     .0155181    .0684581
                   |
         lnnytimes |
               L1. |  -.1092657    .032427    -3.37   0.001    -.1728215   -.0457099
                   |
        ratpercent |
               L1. |  -.2904917   .1537983    -1.89   0.059    -.5919308    .0109474
                   |
     donor_physint |
               L1. |  -.0235462   .0338053    -0.70   0.486    -.0898033     .042711
                   |
           polity2 |
               L1. |   .0345528   .0060709     5.69   0.000      .022654    .0464516
                   |
       lneconaidpc |
               L1. |   .4028991   .0104658    38.50   0.000     .3823864    .4234117
                   |
    lnworldaidecon |   .9531461   .0339303    28.09   0.000     .8866438    1.019648
                   |
          ln_rgdpc |
               L1. |  -.3576923   .0858281    -4.17   0.000    -.5259123   -.1894722
                   |
     ln_population |
               L1. |   .4332526     .05569     7.78   0.000     .3241021     .542403
                   |
          ln_trade |
               L1. |   .0741658   .0103872     7.14   0.000     .0538073    .0945243
                   |
       dyad_colony |   1.845256   .3663998     5.04   0.000     1.127125    2.563386
         socialist |  -.6231848   .2022075    -3.08   0.002    -1.019504   -.2268653
           ColdWar |  -.0491549   .0795737    -0.62   0.537    -.2051166    .1068068
        coldwarsoc |   1.095697   .1222172     8.97   0.000     .8561559    1.335239
                   |
               war |
               L1. |  -.0723093   .0774078    -0.93   0.350    -.2240258    .0794071
                   |
          post2001 |   .0854547   .0915084     0.93   0.350    -.0938985    .2648079
        region_SSA |   .8909407   .2423343     3.68   0.000     .4159742    1.365907
      region_Latin |   .2318028   .2484035     0.93   0.351    -.2550592    .7186647
       region_MENA |  -1.534497   .2927356    -5.24   0.000    -2.108248   -.9607458
   region_EAsiaPac |   .1525011   .2583165     0.59   0.555      -.35379    .6587921
             _cons |  -21.49577    1.23616   -17.39   0.000     -23.9186   -19.07294
-------------------+----------------------------------------------------------------
          /sigma_u |   2.434418   .0620622    39.23   0.000     2.312778    2.556057
          /sigma_e |   2.932385    .019376   151.34   0.000     2.894409    2.970361
-------------------+----------------------------------------------------------------
               rho |   .4080054   .0125986                      .3835109     .432865
------------------------------------------------------------------------------------
        19,219  left-censored observations
        14,091     uncensored observations
             0 right-censored observations

. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |     33,310         .  -42505.63      31    85073.26   85334.09
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. mat icsto = r(S)

. scalar aicsto = icsto[1,5]

. scalar bicsto = icsto[1,6]

. estadd scalar AIC = aicsto: neilsen2

. estadd scalar BIC = bicsto: neilsen2

. 
. 
. * compare to version 9 results
. version 9

. xttobit lneconaidpc PUBRES l.physint l.alliance allXpub l.donorallyneighbor2 neiXpub l.s3un s3unXpub l.lnreftotal l.lnnytimes l.ratpercent l.donor_physint l.polity2 l.
> lneconaidpc lnworldaidecon l.ln_rgdpc l.ln_population l.ln_trade dyad_colony socialist ColdWar coldwarsoc l.war post2001 region_SSA region_Latin region_MENA region_EAs
> iaPac if inmysample==1, ll(0) intpoints(19)

Obtaining starting values for full model:

Iteration 0:   log likelihood =  -73004.91
Iteration 1:   log likelihood = -71852.173
Iteration 2:   log likelihood = -71733.041
Iteration 3:   log likelihood = -71731.147
Iteration 4:   log likelihood = -71731.145

Fitting full model:

Iteration 0:   log likelihood = -53526.568  
Iteration 1:   log likelihood = -47412.045  
Iteration 2:   log likelihood = -44867.828  
Iteration 3:   log likelihood = -44603.212  
Iteration 4:   log likelihood = -44544.139  
Iteration 5:   log likelihood = -44544.052  
Iteration 6:   log likelihood = -44544.052  

Random-effects tobit regression                 Number of obs     =     35,234
Group variable: dyadnum                         Number of groups  =      2,088

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          1
                                                              avg =       16.9
                                                              max =         21

Integration method: aghermite                   Integration pts.  =         19

                                                Wald chi2(28)     =    4886.66
Log likelihood  = -44544.052                    Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
       lneconaidpc |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
            PUBRES |  -1.011692   .2067883    -4.89   0.000     -1.41699   -.6063946
                   |
           physint |
               L1. |  -.0622062   .0159823    -3.89   0.000    -.0935309   -.0308816
                   |
          alliance |
               L1. |   .2994564   .1892163     1.58   0.114    -.0714007    .6703135
                   |
           allXpub |   1.221486   .6067976     2.01   0.044     .0321847    2.410788
                   |
donorallyneighbor2 |
               L1. |  -.0911324   .1774085    -0.51   0.607    -.4388466    .2565819
                   |
           neiXpub |   .7327773   .2528608     2.90   0.004     .2371792    1.228375
                   |
              s3un |
               L1. |  -.1376538   .1756688    -0.78   0.433    -.4819583    .2066506
                   |
          s3unXpub |   1.186843    .430154     2.76   0.006     .3437566    2.029929
                   |
        lnreftotal |
               L1. |   .0432127    .012986     3.33   0.001     .0177606    .0686647
                   |
         lnnytimes |
               L1. |   -.095323   .0315538    -3.02   0.003    -.1571674   -.0334786
                   |
        ratpercent |
               L1. |  -.2110578   .1414332    -1.49   0.136    -.4882617    .0661462
                   |
     donor_physint |
               L1. |  -.0133496   .0334475    -0.40   0.690    -.0789055    .0522064
                   |
           polity2 |
               L1. |   .0340416   .0058038     5.87   0.000     .0226663    .0454168
                   |
       lneconaidpc |
               L1. |    .413558   .0099166    41.70   0.000     .3941218    .4329942
                   |
    lnworldaidecon |   .9149169   .0307503    29.75   0.000     .8546473    .9751865
                   |
          ln_rgdpc |
               L1. |  -.3716124   .0760182    -4.89   0.000    -.5206054   -.2226194
                   |
     ln_population |
               L1. |   .3775888   .0462283     8.17   0.000      .286983    .4681947
                   |
          ln_trade |
               L1. |   .0761024   .0098181     7.75   0.000     .0568593    .0953455
                   |
       dyad_colony |   1.662836   .3540764     4.70   0.000     .9688593    2.356813
         socialist |  -.5472205   .1640913    -3.33   0.001    -.8688337   -.2256074
           ColdWar |  -.0185224   .0782531    -0.24   0.813    -.1718956    .1348508
        coldwarsoc |   1.034867   .1178559     8.78   0.000     .8038731     1.26586
                   |
               war |
               L1. |  -.0777955   .0744509    -1.04   0.296    -.2237166    .0681256
                   |
          post2001 |   .1309609   .0916343     1.43   0.153     -.048639    .3105608
        region_SSA |   .8548612    .203103     4.21   0.000     .4567866    1.252936
      region_Latin |   .3080648   .2059382     1.50   0.135    -.0955667    .7116963
       region_MENA |  -1.112239    .237805    -4.68   0.000    -1.578329     -.64615
   region_EAsiaPac |   .2274593   .2169829     1.05   0.295    -.1978193     .652738
             _cons |  -20.23357   1.066149   -18.98   0.000    -22.32319   -18.14396
-------------------+----------------------------------------------------------------
          /sigma_u |   2.379931   .0589796    40.35   0.000     2.264333    2.495528
          /sigma_e |   2.969501   .0191386   155.16   0.000      2.93199    3.007012
-------------------+----------------------------------------------------------------
               rho |   .3911109   .0121225                      .3675683    .4150595
------------------------------------------------------------------------------------
        20,586  left-censored observations
        14,648     uncensored observations
             0 right-censored observations

. version 14.1

. 
. 
. 
. ***
. * PUBRES with the lag interaction, but no other interactions
. ***
. 
. eststo esdem4: xttobit lneconaidpc PUBRES lagXpub l.physint l.alliance l.donorallyneighbor2 l.s3un l.lnreftotal l.lnnytimes l.ratpercent l.donor_physint l.polity2 l.ln
> econaidpc lnworldaidecon l.ln_rgdpc l.ln_population l.ln_trade dyad_colony socialist ColdWar coldwarsoc l.war post2001 region_SSA region_Latin region_MENA region_EAsia
> Pac if(inmysample==1), ll(0) intpoints(19)

Obtaining starting values for full model:

Iteration 0:   log likelihood = -73011.692
Iteration 1:   log likelihood = -71854.593
Iteration 2:   log likelihood = -71727.743
Iteration 3:   log likelihood = -71725.503
Iteration 4:   log likelihood =   -71725.5

Fitting full model:

Iteration 0:   log likelihood = -53507.586  
Iteration 1:   log likelihood =  -47365.68  
Iteration 2:   log likelihood = -44828.464  
Iteration 3:   log likelihood = -44552.783  
Iteration 4:   log likelihood = -44492.743  
Iteration 5:   log likelihood = -44492.606  
Iteration 6:   log likelihood = -44492.606  

Random-effects tobit regression                 Number of obs     =     35,234
Group variable: dyadnum                         Number of groups  =      2,088

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          1
                                                              avg =       16.9
                                                              max =         21

Integration method: mvaghermite                 Integration pts.  =         19

                                                Wald chi2(26)     =    4576.50
Log likelihood  = -44492.606                    Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
       lneconaidpc |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
            PUBRES |  -.9390143   .1382107    -6.79   0.000    -1.209902   -.6681262
           lagXpub |   .2353936   .0325531     7.23   0.000     .1715907    .2991965
                   |
           physint |
               L1. |  -.0674436   .0161275    -4.18   0.000     -.099053   -.0358342
                   |
          alliance |
               L1. |     .41182   .2052431     2.01   0.045     .0095509    .8140892
                   |
donorallyneighbor2 |
               L1. |    .035882    .202344     0.18   0.859    -.3607049    .4324688
                   |
              s3un |
               L1. |  -.0902474   .1766462    -0.51   0.609    -.4364676    .2559727
                   |
        lnreftotal |
               L1. |   .0458403   .0133429     3.44   0.001     .0196887     .071992
                   |
         lnnytimes |
               L1. |  -.1027126   .0321763    -3.19   0.001     -.165777   -.0396482
                   |
        ratpercent |
               L1. |  -.3019315   .1527497    -1.98   0.048    -.6013154   -.0025476
                   |
     donor_physint |
               L1. |  -.0211667   .0337713    -0.63   0.531    -.0873573    .0450239
                   |
           polity2 |
               L1. |   .0315169   .0059657     5.28   0.000     .0198243    .0432094
                   |
       lneconaidpc |
               L1. |   .3870217   .0104259    37.12   0.000     .3665872    .4074561
                   |
    lnworldaidecon |   .9804503   .0336316    29.15   0.000     .9145335    1.046367
                   |
          ln_rgdpc |
               L1. |  -.3532436   .0840599    -4.20   0.000    -.5179979   -.1884892
                   |
     ln_population |
               L1. |   .4575412   .0558277     8.20   0.000     .3481208    .5669615
                   |
          ln_trade |
               L1. |   .0768664   .0101975     7.54   0.000     .0568796    .0968531
                   |
       dyad_colony |   1.855619   .3710135     5.00   0.000     1.128446    2.582792
         socialist |  -.6575891   .2015381    -3.26   0.001    -1.052597   -.2625817
           ColdWar |  -.0458422   .0796498    -0.58   0.565     -.201953    .1102685
        coldwarsoc |   1.115373   .1185207     9.41   0.000     .8830769     1.34767
                   |
               war |
               L1. |  -.0777671   .0758454    -1.03   0.305    -.2264213    .0708872
                   |
          post2001 |    .120234   .0922074     1.30   0.192    -.0604891    .3009572
        region_SSA |   .9189126   .2441342     3.76   0.000     .4404183    1.397407
      region_Latin |    .232809   .2510819     0.93   0.354    -.2593024    .7249204
       region_MENA |  -1.491078   .2924621    -5.10   0.000    -2.064293    -.917863
   region_EAsiaPac |   .1291553   .2608072     0.50   0.620    -.3820174    .6403281
             _cons |  -22.36134   1.221158   -18.31   0.000    -24.75476   -19.96791
-------------------+----------------------------------------------------------------
          /sigma_u |   2.473806    .061915    39.95   0.000     2.352455    2.595157
          /sigma_e |   2.974314   .0192677   154.37   0.000      2.93655    3.012078
-------------------+----------------------------------------------------------------
               rho |   .4089008   .0123492                      .3848851    .4332635
------------------------------------------------------------------------------------
        20,586  left-censored observations
        14,648     uncensored observations
             0 right-censored observations

. 
. esttab using table4.csv, csv nogaps replace
(output written to table4.csv)

. 
. 
. unique countryname if e(sample)
Number of unique values of countryname is  100
Number of records is  35234

. estadd scalar countries = r(sum): esdem4

. 
. unique donorname if e(sample)
Number of unique values of donorname is  21
Number of records is  35234

. estadd scalar donors = r(sum): esdem4

. 
. unique dyadnum if e(sample)
Number of unique values of dyadnum is  2088
Number of records is  35234

. estadd scalar dyads= r(sum): esdem4

. 
. * how many countries are condemned in the window of this model?
. unique countryname if e(sample) & PUBRES == 1
Number of unique values of countryname is  25
Number of records is  3199

. 
. 
. * calculate common sample AIC/BIC of this model
. xttobit lneconaidpc PUBRES lagXpub l.physint l.alliance l.donorallyneighbor2 l.s3un l.lnreftotal l.lnnytimes l.ratpercent l.donor_physint l.polity2 l.lneconaidpc lnwor
> ldaidecon l.ln_rgdpc l.ln_population l.ln_trade dyad_colony socialist ColdWar coldwarsoc l.war post2001 region_SSA region_Latin region_MENA region_EAsiaPac if(comm_sam
> p==1), ll(0) intpoints(20)

Obtaining starting values for full model:

Iteration 0:   log likelihood = -68923.018
Iteration 1:   log likelihood = -67948.811
Iteration 2:   log likelihood = -67755.973
Iteration 3:   log likelihood = -67749.149
Iteration 4:   log likelihood = -67749.128

Fitting full model:

Iteration 0:   log likelihood = -50893.837  
Iteration 1:   log likelihood = -45243.678  
Iteration 2:   log likelihood = -42787.109  
Iteration 3:   log likelihood = -42536.432  
Iteration 4:   log likelihood = -42489.207  
Iteration 5:   log likelihood = -42489.128  
Iteration 6:   log likelihood = -42489.128  

Random-effects tobit regression                 Number of obs     =     33,310
Group variable: dyadnum                         Number of groups  =      2,086

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          2
                                                              avg =       16.0
                                                              max =         20

Integration method: mvaghermite                 Integration pts.  =         20

                                                Wald chi2(26)     =    4264.78
Log likelihood  = -42489.128                    Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
       lneconaidpc |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
            PUBRES |  -.8917293   .1410411    -6.32   0.000    -1.168165   -.6152938
           lagXpub |   .2215909   .0329972     6.72   0.000     .1569176    .2862642
                   |
           physint |
               L1. |  -.0558594   .0164833    -3.39   0.001    -.0881662   -.0235527
                   |
          alliance |
               L1. |   .4367055    .206888     2.11   0.035     .0312124    .8421986
                   |
donorallyneighbor2 |
               L1. |   .1139975   .2023157     0.56   0.573    -.2825341    .5105291
                   |
              s3un |
               L1. |  -.0917736   .1773812    -0.52   0.605    -.4394344    .2558873
                   |
        lnreftotal |
               L1. |   .0445787    .013474     3.31   0.001     .0181701    .0709873
                   |
         lnnytimes |
               L1. |  -.1106663   .0323972    -3.42   0.001    -.1741636   -.0471689
                   |
        ratpercent |
               L1. |  -.2974134   .1535358    -1.94   0.053     -.598338    .0035113
                   |
     donor_physint |
               L1. |  -.0252627   .0337793    -0.75   0.455    -.0914689    .0409434
                   |
           polity2 |
               L1. |   .0338941   .0060685     5.59   0.000     .0220001    .0457881
                   |
       lneconaidpc |
               L1. |     .39001   .0106476    36.63   0.000     .3691411     .410879
                   |
    lnworldaidecon |   .9553793   .0338918    28.19   0.000     .8889525    1.021806
                   |
          ln_rgdpc |
               L1. |  -.3679881   .0856297    -4.30   0.000    -.5358193   -.2001569
                   |
     ln_population |
               L1. |   .4462207   .0555311     8.04   0.000     .3373817    .5550596
                   |
          ln_trade |
               L1. |   .0730167   .0103839     7.03   0.000     .0526646    .0933688
                   |
       dyad_colony |   1.826408   .3654985     5.00   0.000     1.110044    2.542772
         socialist |  -.6725943   .2013846    -3.34   0.001    -1.067301   -.2778877
           ColdWar |  -.0651349    .079481    -0.82   0.412    -.2209149     .090645
        coldwarsoc |    1.13605    .121707     9.33   0.000     .8975083    1.374591
                   |
               war |
               L1. |  -.0711168   .0773282    -0.92   0.358    -.2226773    .0804438
                   |
          post2001 |   .0842266   .0914506     0.92   0.357    -.0950133    .2634666
        region_SSA |   .9312775   .2416652     3.85   0.000     .4576224    1.404933
      region_Latin |   .2847875   .2476422     1.15   0.250    -.2005822    .7701573
       region_MENA |  -1.438121   .2908574    -4.94   0.000    -2.008191   -.8680515
   region_EAsiaPac |   .1654395   .2574649     0.64   0.521    -.3391825    .6700614
             _cons |  -21.55542   1.233717   -17.47   0.000    -23.97346   -19.13738
-------------------+----------------------------------------------------------------
          /sigma_u |   2.427315   .0616726    39.36   0.000     2.306439    2.548191
          /sigma_e |   2.930601   .0193607   151.37   0.000     2.892655    2.968548
-------------------+----------------------------------------------------------------
               rho |   .4068883    .012544                      .3825013    .4316419
------------------------------------------------------------------------------------
        19,219  left-censored observations
        14,091     uncensored observations
             0 right-censored observations

. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |     33,310         .  -42489.13      29    85036.26   85280.25
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. mat icsto = r(S)

. scalar aicsto = icsto[1,5]

. scalar bicsto = icsto[1,6]

. estadd scalar AIC = aicsto: esdem4

. estadd scalar BIC = bicsto: esdem4

. 
.         
. 
. esttab neilsen neilsen2 esdem3 esdem4 using "neilsen.tex", title("State-dependence in Dyadic Bilateral Aid Flows*\label{tab:Neilsen-1}") longtable replace keep(L.lneco
> naidpc L.physint PUBRES lagXpub L.alliance L.alliance_physint allXpub L.donorallyneighbor2 L.allyneighbor2_physint neiXpub L.s3un L.s3un_physint s3unXpub) order(L.lnec
> onaidpc L.physint PUBRES lagXpub L.alliance L.alliance_physint allXpub L.donorallyneighbor2 L.allyneighbor2_physint neiXpub L.s3un L.s3un_physint s3unXpub) eqlabels(,n
> one) nomtitles nodepvars coeflabels(L.lneconaidpc  "DV\$_{i(t-1)}$" L.physint  "Physical Integrity Violations\$_{i(t-1)}$" PUBRES "UNCHR Resolution\$_{i(t-1)}$" lagXpu
> b "DV\$_{i(t-1)}$ * Resolution\$_{i(t-1)}$" L.alliance "Alliance\$_{i(t-1)}$" L.alliance_physint "Alliance\$_{i(t-1)}$ * Violations\$_{i(t-1)}$" allXpub "Alliance\$_{i
> (t-1)}$ * Resolution\$_{i(t-1)}$" L.donorallyneighbor2 "Ally Neighbor\$_{i(t-1)}$" L.allyneighbor2_physint "Ally Neighbor\$_{i(t-1)}$ * Violations\$_{i(t-1)}$" neiXpub
>  "Ally Neighbor\$_{i(t-1)}$ * Resolution\$_{i(t-1)}$" L.s3un "UN Voting Similarity\$_{i(t-1)}$" L.s3un_physint "UN Similarity\$_{i(t-1)}$ * Violations\$_{i(t-1)}$" s3u
> nXpub "UN Similarity\$_{i(t-1)}$ * Resolution\$_{i(t-1)}$") noabbrev wrap gaps varwidth(48) align(r) substitute(\_ _) stats(N dyads countries donors blank AIC BIC, lab
> els("Observations" "Dyads" "Recipients" "Donors" " " "AIC" "BIC"))
(output written to neilsen.tex)

. 
. 
. 
. 
. 
. 
. *****************************************************
. * Neilsen data
. * dyadic aid flow analysis
. * Murdie/Davis NGO Shaming variable
. *****************************************************
. 
. 
. clear all

. set more off

. set matsize 800

. 
. 
. ** merge in NGO data
. use "ISQ 2010 Murdie Davis final to ISQ.dta", clear

. rename cowcode countrynumcode_g

. save murdie_merge.dta, replace
file murdie_merge.dta saved

. 
. ** merge in public resolution data
. use jprworkdatanew.dta, clear

. rename YEAR year 

. rename CCODE countrynumcode_g

. save jpr_merge.dta, replace
file jpr_merge.dta saved

. 
. use "dat2.dta", clear

. 
. merge m:1 year countrynumcode_g year using murdie_merge.dta
(note: variable year was int, now double to accommodate using data's values)
(note: variable countrynumcode_g was int, now float to accommodate using data's values)

    Result                           # of obs.
    -----------------------------------------
    not matched                        15,749
        from master                    12,096  (_merge==1)
        from using                      3,653  (_merge==2)

    matched                           107,961  (_merge==3)
    -----------------------------------------

. drop if _merge==2
(3,653 observations deleted)

. 
. drop _merge

. 
. merge m:1 year countrynumcode_g year using jpr_merge.dta

    Result                           # of obs.
    -----------------------------------------
    not matched                        51,079
        from master                    50,316  (_merge==1)
        from using                        763  (_merge==2)

    matched                            69,741  (_merge==3)
    -----------------------------------------

. drop if _merge==2
(763 observations deleted)

. 
. tsset dyadnum year
       panel variable:  dyadnum (unbalanced)
        time variable:  year, 1980 to 2006, but with gaps
                delta:  1 unit

. 
. 
. * no interactions
. eststo ngoplain: tobit lneconaidpc L.HRnc2gcnc2 l.physint l.alliance l.donorallyneighbor2 l.s3un l.lnreftotal l.lnnytimes l.ratpercent l.donor_physint l.polity2 l.lnec
> onaidpc lnworldaidecon l.ln_rgdpc l.ln_population l.ln_trade dyad_colony socialist l.war post2001 region_SSA region_Latin region_MENA region_EAsiaPac if(inmysample==1)
> , ll(0) cluster(dyadnum)

Tobit regression                                Number of obs     =     25,142
                                                F(  23,  25119)   =     455.78
                                                Prob > F          =     0.0000
Log pseudolikelihood = -33919.127               Pseudo R2         =     0.2536

                                  (Std. Err. adjusted for 2,308 clusters in dyadnum)
------------------------------------------------------------------------------------
                   |               Robust
       lneconaidpc |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
        HRnc2gcnc2 |
               L1. |    .028062   .0159164     1.76   0.078    -.0031351    .0592591
                   |
           physint |
               L1. |   -.033091   .0178194    -1.86   0.063    -.0680181    .0018361
                   |
          alliance |
               L1. |   .4049498    .106928     3.79   0.000     .1953646     .614535
                   |
donorallyneighbor2 |
               L1. |   .2891013   .1080328     2.68   0.007     .0773507    .5008518
                   |
              s3un |
               L1. |  -.0735625   .1243946    -0.59   0.554    -.3173831    .1702582
                   |
        lnreftotal |
               L1. |   .0626599   .0139297     4.50   0.000     .0353569    .0899628
                   |
         lnnytimes |
               L1. |  -.0370711   .0316794    -1.17   0.242    -.0991645    .0250224
                   |
        ratpercent |
               L1. |   .3533094   .1168864     3.02   0.003     .1242052    .5824135
                   |
     donor_physint |
               L1. |  -.0213361   .0369648    -0.58   0.564    -.0937892    .0511171
                   |
           polity2 |
               L1. |   .0362283   .0061362     5.90   0.000      .024201    .0482555
                   |
       lneconaidpc |
               L1. |   .8520797   .0139003    61.30   0.000     .8248344    .8793251
                   |
    lnworldaidecon |   .4683384    .020792    22.52   0.000     .4275849     .509092
                   |
          ln_rgdpc |
               L1. |  -.4451342   .0573243    -7.77   0.000    -.5574931   -.3327753
                   |
     ln_population |
               L1. |   .1962305   .0323165     6.07   0.000     .1328883    .2595726
                   |
          ln_trade |
               L1. |   .0427949   .0115345     3.71   0.000     .0201865    .0654033
                   |
       dyad_colony |   .3943071   .1322782     2.98   0.003     .1350341      .65358
         socialist |   .0660134   .0886719     0.74   0.457    -.1077888    .2398156
                   |
               war |
               L1. |   -.073297    .072063    -1.02   0.309    -.2145448    .0679507
                   |
          post2001 |   .0583052   .0444591     1.31   0.190    -.0288371    .1454476
        region_SSA |   .4792762   .1221655     3.92   0.000     .2398248    .7187276
      region_Latin |   .4622171   .1132065     4.08   0.000     .2403256    .6841085
       region_MENA |   -.155575   .1658908    -0.94   0.348    -.4807306    .1695807
   region_EAsiaPac |   .3988162   .1175974     3.39   0.001     .1683185    .6293139
             _cons |  -9.969246   .7717234   -12.92   0.000    -11.48187   -8.456623
-------------------+----------------------------------------------------------------
            /sigma |   2.860004   .0428258                      2.776063    2.943945
------------------------------------------------------------------------------------
        13,406  left-censored observations at lneconaidpc <= 0
        11,736     uncensored observations
             0 right-censored observations

. 
. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
    ngoplain |     25,142  -45441.7  -33919.13      25    67888.25   68091.56
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. mat icsto = r(S)

. scalar aicsto = icsto[1,5]

. scalar bicsto = icsto[1,6]

. estadd scalar AIC = aicsto: ngoplain

. estadd scalar BIC = bicsto: ngoplain

. 
. scalar drop aicsto bicsto

. mat drop icsto

. 
. unique countryname if e(sample)
Number of unique values of countryname is  110
Number of records is  25142

. estadd scalar countries = r(sum): ngoplain

. 
. unique donorname if e(sample)
Number of unique values of donorname is  21
Number of records is  25142

. estadd scalar donors = r(sum): ngoplain

. 
. unique dyadnum if e(sample)
Number of unique values of dyadnum is  2308
Number of records is  25142

. estadd scalar dyads= r(sum): ngoplain

. 
. 
. gen allXngo = l.HRnc2gcnc2*l.alliance
(78,246 missing values generated)

. gen neiXngo = l.HRnc2gcnc2*l.donorallyneighbor2
(63,441 missing values generated)

. gen s3unXngo = l.HRnc2gcnc2*l.s3un
(67,968 missing values generated)

. 
. gen lagXngo = l.HRnc2gcnc2*l.lneconaidpc
(76,209 missing values generated)

. 
. * lag interaction with PUBRES only
. eststo ngoreg: tobit lneconaidpc L.HRnc2gcnc2 lagXngo l.physint l.alliance l.donorallyneighbor2 l.s3un l.lnreftotal l.lnnytimes l.ratpercent l.donor_physint l.polity2 
> l.lneconaidpc lnworldaidecon l.ln_rgdpc l.ln_population l.ln_trade dyad_colony socialist l.war post2001 region_SSA region_Latin region_MENA region_EAsiaPac if(inmysamp
> le==1), ll(0) cluster(dyadnum)

Tobit regression                                Number of obs     =     25,142
                                                F(  24,  25118)   =     437.53
                                                Prob > F          =     0.0000
Log pseudolikelihood = -33919.123               Pseudo R2         =     0.2536

                                  (Std. Err. adjusted for 2,308 clusters in dyadnum)
------------------------------------------------------------------------------------
                   |               Robust
       lneconaidpc |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
        HRnc2gcnc2 |
               L1. |   .0298704   .0277428     1.08   0.282    -.0245072     .084248
                   |
           lagXngo |  -.0005717   .0064079    -0.09   0.929    -.0131316    .0119882
                   |
           physint |
               L1. |  -.0330769   .0178164    -1.86   0.063    -.0679981    .0018443
                   |
          alliance |
               L1. |   .4049176   .1069236     3.79   0.000     .1953411     .614494
                   |
donorallyneighbor2 |
               L1. |   .2888633   .1081731     2.67   0.008     .0768378    .5008889
                   |
              s3un |
               L1. |  -.0733503   .1242189    -0.59   0.555    -.3168266    .1701261
                   |
        lnreftotal |
               L1. |   .0626657   .0139319     4.50   0.000     .0353584     .089973
                   |
         lnnytimes |
               L1. |   -.037097   .0316869    -1.17   0.242    -.0992053    .0250112
                   |
        ratpercent |
               L1. |   .3533426   .1169121     3.02   0.003     .1241881    .5824971
                   |
     donor_physint |
               L1. |  -.0214197   .0369947    -0.58   0.563    -.0939314     .051092
                   |
           polity2 |
               L1. |   .0362116   .0061462     5.89   0.000     .0241646    .0482585
                   |
       lneconaidpc |
               L1. |   .8522481   .0140052    60.85   0.000      .824797    .8796991
                   |
    lnworldaidecon |   .4683913   .0207931    22.53   0.000     .4276357    .5091469
                   |
          ln_rgdpc |
               L1. |  -.4450943   .0573357    -7.76   0.000    -.5574756   -.3327131
                   |
     ln_population |
               L1. |   .1961791    .032312     6.07   0.000     .1328457    .2595126
                   |
          ln_trade |
               L1. |   .0427908   .0115352     3.71   0.000     .0201811    .0654004
                   |
       dyad_colony |   .3942057   .1322608     2.98   0.003     .1349667    .6534447
         socialist |   .0659225   .0886606     0.74   0.457    -.1078575    .2397024
                   |
               war |
               L1. |  -.0733075   .0720688    -1.02   0.309    -.2145665    .0679515
                   |
          post2001 |    .058192   .0444906     1.31   0.191    -.0290121    .1453961
        region_SSA |   .4790369   .1222224     3.92   0.000     .2394739    .7185999
      region_Latin |   .4620296   .1132645     4.08   0.000     .2400245    .6840347
       region_MENA |  -.1557398     .16593    -0.94   0.348    -.4809724    .1694927
   region_EAsiaPac |   .3987483   .1176197     3.39   0.001     .1682068    .6292897
             _cons |  -9.969945   .7717881   -12.92   0.000    -11.48269   -8.457195
-------------------+----------------------------------------------------------------
            /sigma |   2.860022    .042814                      2.776104     2.94394
------------------------------------------------------------------------------------
        13,406  left-censored observations at lneconaidpc <= 0
        11,736     uncensored observations
             0 right-censored observations

. 
. 
. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
      ngoreg |     25,142  -45441.7  -33919.12      26    67890.25   68101.68
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. mat icsto = r(S)

. scalar aicsto = icsto[1,5]

. scalar bicsto = icsto[1,6]

. estadd scalar AIC = aicsto: ngoreg

. estadd scalar BIC = bicsto: ngoreg

. 
. 
. tab year if e(sample)

       year |      Freq.     Percent        Cum.
------------+-----------------------------------
       1993 |      1,760        7.00        7.00
       1994 |      1,989        7.91       14.91
       1995 |      1,905        7.58       22.49
       1996 |      1,968        7.83       30.32
       1997 |      2,045        8.13       38.45
       1998 |      2,260        8.99       47.44
       1999 |      2,218        8.82       56.26
       2000 |      2,257        8.98       65.24
       2001 |      2,243        8.92       74.16
       2002 |      2,239        8.91       83.06
       2003 |      2,243        8.92       91.99
       2004 |      2,015        8.01      100.00
------------+-----------------------------------
      Total |     25,142      100.00

. 
. unique countryname if e(sample)
Number of unique values of countryname is  110
Number of records is  25142

. estadd scalar countries = r(sum): ngoreg

. 
. unique donorname if e(sample)
Number of unique values of donorname is  21
Number of records is  25142

. estadd scalar donors = r(sum): ngoreg

. 
. unique dyadnum if e(sample)
Number of unique values of dyadnum is  2308
Number of records is  25142

. estadd scalar dyads= r(sum): ngoreg

. 
. 
. * save information necessary to generate marginal effects plots
. matrix b=e(b)

. mat2txt, matrix(b) saving(tobit_beta_ngo.txt) replace

. 
. matrix V=e(V)

. mat2txt, matrix(V) saving(tobit_VCV_ngo.txt) replace

. 
. 
. 
. 
. 
. clear

. set mem 1000M
set memory ignored.
    Memory no longer needs to be set in modern Statas; memory adjustments are performed on the fly automatically.

. set more off

. set matsize 800

. 
. 
. 
. ** merge in NGO data
. use "ISQ 2010 Murdie Davis final to ISQ.dta", clear

. rename cowcode countrynumcode_g

. save murdie_merge.dta, replace
file murdie_merge.dta saved

. 
. use "dat2.dta", clear

. 
. merge m:1 year countrynumcode_g year using murdie_merge.dta
(note: variable year was int, now double to accommodate using data's values)
(note: variable countrynumcode_g was int, now float to accommodate using data's values)

    Result                           # of obs.
    -----------------------------------------
    not matched                        15,749
        from master                    12,096  (_merge==1)
        from using                      3,653  (_merge==2)

    matched                           107,961  (_merge==3)
    -----------------------------------------

. drop if _merge==2
(3,653 observations deleted)

. 
. tsset dyadnum year
       panel variable:  dyadnum (unbalanced)
        time variable:  year, 1980 to 2006, but with gaps
                delta:  1 unit

. 
. 
. gen ngodum = .
(120,057 missing values generated)

. replace ngodum = 1 if l.HRnc2gcnc2>=1 & l.HRnc2gcnc2!=.
(4,788 real changes made)

. replace ngodum = 0 if l.HRnc2gcnc2<1 & l.HRnc2gcnc2!=.
(55,818 real changes made)

. 
. 
. * no interactions
. eststo ngoplain2: tobit lneconaidpc ngodum l.physint l.alliance l.donorallyneighbor2 l.s3un l.lnreftotal l.lnnytimes l.ratpercent l.donor_physint l.polity2 l.lneconaid
> pc lnworldaidecon l.ln_rgdpc l.ln_population l.ln_trade dyad_colony socialist l.war post2001 region_SSA region_Latin region_MENA region_EAsiaPac if(inmysample==1), ll(
> 0) cluster(dyadnum)

Tobit regression                                Number of obs     =     25,142
                                                F(  23,  25119)   =     456.50
                                                Prob > F          =     0.0000
Log pseudolikelihood = -33917.716               Pseudo R2         =     0.2536

                                  (Std. Err. adjusted for 2,308 clusters in dyadnum)
------------------------------------------------------------------------------------
                   |               Robust
       lneconaidpc |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
            ngodum |   .1704883   .0689116     2.47   0.013     .0354174    .3055591
                   |
           physint |
               L1. |  -.0339644   .0178351    -1.90   0.057    -.0689223    .0009935
                   |
          alliance |
               L1. |   .4094709   .1068102     3.83   0.000     .2001167    .6188251
                   |
donorallyneighbor2 |
               L1. |   .2898022   .1079452     2.68   0.007     .0782233    .5013812
                   |
              s3un |
               L1. |  -.0738977   .1244922    -0.59   0.553    -.3179097    .1701142
                   |
        lnreftotal |
               L1. |   .0617075    .013917     4.43   0.000     .0344294    .0889856
                   |
         lnnytimes |
               L1. |  -.0393393   .0317111    -1.24   0.215     -.101495    .0228164
                   |
        ratpercent |
               L1. |   .3529798   .1168166     3.02   0.003     .1240124    .5819471
                   |
     donor_physint |
               L1. |  -.0213629   .0369443    -0.58   0.563    -.0937759    .0510501
                   |
           polity2 |
               L1. |   .0363676   .0061247     5.94   0.000     .0243628    .0483723
                   |
       lneconaidpc |
               L1. |   .8522202   .0138979    61.32   0.000     .8249795    .8794609
                   |
    lnworldaidecon |   .4683777    .020785    22.53   0.000     .4276378    .5091176
                   |
          ln_rgdpc |
               L1. |  -.4463954   .0572688    -7.79   0.000    -.5586457   -.3341452
                   |
     ln_population |
               L1. |   .1932887   .0322287     6.00   0.000     .1301186    .2564588
                   |
          ln_trade |
               L1. |   .0425779   .0115209     3.70   0.000     .0199963    .0651595
                   |
       dyad_colony |   .3924174   .1319087     2.97   0.003     .1338686    .6509661
         socialist |   .0715907   .0885758     0.81   0.419     -.102023    .2452044
                   |
               war |
               L1. |  -.0717017   .0720819    -0.99   0.320    -.2129864     .069583
                   |
          post2001 |   .0525044   .0447751     1.17   0.241    -.0352574    .1402662
        region_SSA |   .4835985   .1218416     3.97   0.000     .2447818    .7224152
      region_Latin |   .4680686   .1129749     4.14   0.000     .2466312     .689506
       region_MENA |  -.1491854   .1649307    -0.90   0.366    -.4724591    .1740883
   region_EAsiaPac |   .4005646   .1174654     3.41   0.001     .1703255    .6308037
             _cons |  -9.931943   .7713119   -12.88   0.000    -11.44376   -8.420126
-------------------+----------------------------------------------------------------
            /sigma |   2.859833    .042833                      2.775878    2.943788
------------------------------------------------------------------------------------
        13,406  left-censored observations at lneconaidpc <= 0
        11,736     uncensored observations
             0 right-censored observations

. 
. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
   ngoplain2 |     25,142  -45441.7  -33917.72      25    67885.43   68088.74
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. mat icsto = r(S)

. scalar aicsto = icsto[1,5]

. scalar bicsto = icsto[1,6]

. estadd scalar AIC = aicsto: ngoplain2

. estadd scalar BIC = bicsto: ngoplain2

. 
. unique countryname if e(sample)
Number of unique values of countryname is  110
Number of records is  25142

. estadd scalar countries = r(sum): ngoplain2

. 
. unique donorname if e(sample)
Number of unique values of donorname is  21
Number of records is  25142

. estadd scalar donors = r(sum): ngoplain2

. 
. unique dyadnum if e(sample)
Number of unique values of dyadnum is  2308
Number of records is  25142

. estadd scalar dyads= r(sum): ngoplain2

. 
. gen allXngodum = ngodum*l.alliance
(78,246 missing values generated)

. gen neiXngodum = ngodum*l.donorallyneighbor2
(63,441 missing values generated)

. gen s3unXngodum = ngodum*l.s3un
(67,968 missing values generated)

. 
. gen lagXngodum = ngodum*l.lneconaidpc
(76,209 missing values generated)

. 
. 
. * lag interaction with PUBRES only
. eststo ngoreg2: tobit lneconaidpc ngodum lagXngodum l.physint l.alliance l.donorallyneighbor2 l.s3un l.lnreftotal l.lnnytimes l.ratpercent l.donor_physint l.polity2 l.
> lneconaidpc lnworldaidecon l.ln_rgdpc l.ln_population l.ln_trade dyad_colony socialist l.war post2001 region_SSA region_Latin region_MENA region_EAsiaPac if(inmysample
> ==1), ll(0) cluster(dyadnum)

Tobit regression                                Number of obs     =     25,142
                                                F(  24,  25118)   =     438.82
                                                Prob > F          =     0.0000
Log pseudolikelihood = -33917.668               Pseudo R2         =     0.2536

                                  (Std. Err. adjusted for 2,308 clusters in dyadnum)
------------------------------------------------------------------------------------
                   |               Robust
       lneconaidpc |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
            ngodum |   .1946668   .1186333     1.64   0.101    -.0378614     .427195
        lagXngodum |  -.0078817   .0268661    -0.29   0.769    -.0605408    .0447773
                   |
           physint |
               L1. |  -.0338916   .0178371    -1.90   0.057    -.0688534    .0010701
                   |
          alliance |
               L1. |    .409285   .1067751     3.83   0.000     .1999997    .6185704
                   |
donorallyneighbor2 |
               L1. |   .2888398   .1081058     2.67   0.008     .0769461    .5007334
                   |
              s3un |
               L1. |  -.0731285   .1243382    -0.59   0.556    -.3168388    .1705817
                   |
        lnreftotal |
               L1. |   .0617515   .0139246     4.43   0.000     .0344584    .0890445
                   |
         lnnytimes |
               L1. |  -.0393646   .0317309    -1.24   0.215     -.101559    .0228299
                   |
        ratpercent |
               L1. |   .3530568   .1168631     3.02   0.003     .1239983    .5821153
                   |
     donor_physint |
               L1. |  -.0215495   .0369434    -0.58   0.560    -.0939607    .0508617
                   |
           polity2 |
               L1. |   .0363239   .0061306     5.93   0.000     .0243076    .0483402
                   |
       lneconaidpc |
               L1. |    .852995   .0142253    59.96   0.000     .8251126    .8808773
                   |
    lnworldaidecon |   .4686036   .0207836    22.55   0.000     .4278666    .5093406
                   |
          ln_rgdpc |
               L1. |  -.4462519   .0572773    -7.79   0.000    -.5585187    -.333985
                   |
     ln_population |
               L1. |   .1929558   .0322597     5.98   0.000     .1297249    .2561867
                   |
          ln_trade |
               L1. |    .042544   .0115211     3.69   0.000     .0199619    .0651261
                   |
       dyad_colony |    .392553   .1319772     2.97   0.003       .13387     .651236
         socialist |   .0711103   .0885978     0.80   0.422    -.1025465    .2447671
                   |
               war |
               L1. |  -.0716753    .072116    -0.99   0.320    -.2130269    .0696762
                   |
          post2001 |   .0523029   .0447976     1.17   0.243     -.035503    .1401089
        region_SSA |   .4822002   .1220976     3.95   0.000     .2428818    .7215185
      region_Latin |   .4668576   .1132861     4.12   0.000     .2448102    .6889049
       region_MENA |   -.149645   .1649693    -0.91   0.364    -.4729944    .1737044
   region_EAsiaPac |   .4002663    .117498     3.41   0.001     .1699634    .6305692
             _cons |    -9.9349    .771475   -12.88   0.000    -11.44704   -8.422763
-------------------+----------------------------------------------------------------
            /sigma |   2.859896   .0428153                      2.775975    2.943817
------------------------------------------------------------------------------------
        13,406  left-censored observations at lneconaidpc <= 0
        11,736     uncensored observations
             0 right-censored observations

. 
. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
     ngoreg2 |     25,142  -45441.7  -33917.67      26    67887.34   68098.78
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. mat icsto = r(S)

. scalar aicsto = icsto[1,5]

. scalar bicsto = icsto[1,6]

. estadd scalar AIC = aicsto: ngoreg2

. estadd scalar BIC = bicsto: ngoreg2

. 
. tab year if e(sample)

       year |      Freq.     Percent        Cum.
------------+-----------------------------------
       1993 |      1,760        7.00        7.00
       1994 |      1,989        7.91       14.91
       1995 |      1,905        7.58       22.49
       1996 |      1,968        7.83       30.32
       1997 |      2,045        8.13       38.45
       1998 |      2,260        8.99       47.44
       1999 |      2,218        8.82       56.26
       2000 |      2,257        8.98       65.24
       2001 |      2,243        8.92       74.16
       2002 |      2,239        8.91       83.06
       2003 |      2,243        8.92       91.99
       2004 |      2,015        8.01      100.00
------------+-----------------------------------
      Total |     25,142      100.00

. 
. unique countryname if e(sample)
Number of unique values of countryname is  110
Number of records is  25142

. estadd scalar countries = r(sum): ngoreg2

. 
. unique donorname if e(sample)
Number of unique values of donorname is  21
Number of records is  25142

. estadd scalar donors = r(sum): ngoreg2

. 
. unique dyadnum if e(sample)
Number of unique values of dyadnum is  2308
Number of records is  25142

. estadd scalar dyads= r(sum): ngoreg2

. 
. * save information necessary to generate marginal effects plots
. matrix b=e(b)

. mat2txt, matrix(b) saving(tobit_beta_ngo2.txt) replace

. 
. matrix V=e(V)

. mat2txt, matrix(V) saving(tobit_VCV_ngo2.txt) replace

. 
. 
. esttab ngoplain ngoreg ngoplain2 ngoreg2 using "ngo-tobits.tex", title("State-Dependence in Dyadic Bilateral Economic Aid Flows, Murdie and Davis (2012) NGO Shaming Me
> asure*\label{tab:State-Dependence-NGO}") longtable replace order(L.lneconaidpc L.physint L.HRnc2gcnc2 lagXngo ngodum lagXngodum L.alliance L.donorallyneighbor2 L.s3un)
>  keep(L.lneconaidpc L.HRnc2gcnc2 lagXngo ngodum lagXngodum L.physint L.alliance L.donorallyneighbor2 L.s3un) eqlabels(,none) nomtitles nodepvars coeflabels(L.lneconaid
> pc "DV\$_{i(t-1)}$" L.physint "Physical Integrity Violations\$\_{i(t-1)}$" L.HRnc2gcnc2 "NGO Shaming\$\_{i(t-1)}$" lagXngo "DV\$\_{i(t-1)}$ * NGO Shaming\$\_{i(t-1)}$"
>  ngodum "NGO Shaming\$\_{i(t-1)} \geq 1$" lagXngodum "DV\$\_{i(t-1)}$ * NGO Shaming\$\_{i(t-1)} \geq 1$" L.alliance "Alliance\$\_{i(t-1)}$" L.donorallyneighbor2 "Ally 
> Neighbor\$\_{i(t-1)}$" L.s3un "UN Voting Similarity\$\_{i(t-1)}$") noabbrev wrap gaps varwidth(50) align(r) substitute(\_ _) stats(N dyads countries donors blank AIC B
> IC, labels("Observations" "Dyads" "Recipients" "Donors" " " "AIC" "BIC"))
(output written to ngo-tobits.tex)

. 
. gen l_lneconaidpc = L.lneconaidpc
(35,910 missing values generated)

. keep if e(sample)
(94,915 observations deleted)

. saveold "ngo-shaming.dta", replace version(12)
(saving in Stata 12 format, which can be read by Stata 11 or 12)
file ngo-shaming.dta saved

. 
. 
. 
. *****************************************************
. * Lebovic and Voeten data
. * aggregate bilateral aid analysis
. *****************************************************
. 
. clear all

. 
. use "ISQ 2010 Murdie Davis final to ISQ.dta", clear

. rename cowcode CCODE

. rename year YEAR

. save murdie_merge.dta, replace
file murdie_merge.dta saved

. 
. 
. quietly{

. 
. * Begin replication code provided by the authors):
. * (Lebovic and Voeten Table 2)
. 
. quietly{

. 
. * LV Table 2 replication
. eststo lvrep: xtreg BIPOP l.BIPOP PUBRES  d.HRIGHTS l.HRIGHTS d.CIVIL l.CIVIL l.GDPPOP l.LNPOP l.USAGREE WAR CAPAB linear quad , mle i(CCODE) nolog

Random-effects ML regression                    Number of obs     =      2,324
Group variable: CCODE                           Number of groups  =        118

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          4
                                                              avg =       19.7
                                                              max =         24

                                                LR chi2(13)       =    1108.44
Log likelihood  = -1790.6884                    Prob > chi2       =     0.0000

------------------------------------------------------------------------------
       BIPOP |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       BIPOP |
         L1. |   .5534308    .021695    25.51   0.000     .5109095    .5959521
             |
      PUBRES |  -.0299108   .0592218    -0.51   0.614    -.1459834    .0861618
             |
     HRIGHTS |
         D1. |  -.0370041   .0168539    -2.20   0.028    -.0700371    -.003971
         L1. |  -.0175262   .0182198    -0.96   0.336    -.0532364     .018184
             |
       CIVIL |
         D1. |   -.015488    .019382    -0.80   0.424    -.0534761    .0225001
         L1. |  -.0204725   .0127657    -1.60   0.109    -.0454927    .0045477
             |
      GDPPOP |
         L1. |  -.1071822   .0251318    -4.26   0.000    -.1564396   -.0579248
             |
       LNPOP |
         L1. |  -.1622352   .0310424    -5.23   0.000    -.2230772   -.1013932
             |
     USAGREE |
         L1. |  -.1233561   .1449618    -0.85   0.395    -.4074759    .1607637
             |
         WAR |  -.0876562   .0344434    -2.54   0.011    -.1551642   -.0201483
       CAPAB |  -.7585355   .6053562    -1.25   0.210    -1.945012    .4279409
      linear |  -.0049127   .0011152    -4.41   0.000    -.0070984    -.002727
        quad |  -.0000462   .0000855    -0.54   0.589    -.0002137    .0001213
       _cons |    4.90283   .5660223     8.66   0.000     3.793447    6.012213
-------------+----------------------------------------------------------------
    /sigma_u |   .3851992   .0383154                      .3169693    .4681162
    /sigma_e |   .4906449   .0075666                      .4760366    .5057015
         rho |   .3813269   .0486669                      .2903889    .4793654
------------------------------------------------------------------------------
LR test of sigma_u=0: chibar2(01) = 107.35             Prob >= chibar2 = 0.000

. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
       lvrep |      2,324 -2344.908  -1790.688      16    3613.377   3705.393
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. mat icsto = r(S)

. scalar aicsto = icsto[1,5]

. scalar bicsto = icsto[1,6]

. estadd scalar AIC = aicsto: lvrep

. estadd scalar BIC = bicsto: lvrep

. 
. unique CCODE if e(sample)
Number of unique values of CCODE is  118
Number of records is  2324

. estadd scalar countries = r(sum): lvrep

. 
. tab YEAR if e(sample)

       year |      Freq.     Percent        Cum.
------------+-----------------------------------
       1979 |         82        3.53        3.53
       1980 |         84        3.61        7.14
       1981 |         89        3.83       10.97
       1982 |         90        3.87       14.85
       1983 |         90        3.87       18.72
       1984 |         90        3.87       22.59
       1985 |         91        3.92       26.51
       1986 |         95        4.09       30.59
       1987 |         95        4.09       34.68
       1988 |         95        4.09       38.77
       1989 |         97        4.17       42.94
       1990 |         97        4.17       47.12
       1991 |         98        4.22       51.33
       1992 |         94        4.04       55.38
       1993 |         94        4.04       59.42
       1994 |         99        4.26       63.68
       1995 |         99        4.26       67.94
       1996 |        105        4.52       72.46
       1997 |        106        4.56       77.02
       1998 |        108        4.65       81.67
       1999 |        108        4.65       86.32
       2000 |        106        4.56       90.88
       2001 |        106        4.56       95.44
       2002 |        106        4.56      100.00
------------+-----------------------------------
      Total |      2,324      100.00

. 
. * variation in variables in this model
. summarize BIPOP PUBRES  d.HRIGHTS l.HRIGHTS d.CIVIL l.CIVIL l.GDPPOP l.LNPOP l.USAGREE WAR CAPAB linear quad  if e(sample)

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
       BIPOP |      2,324    3.065869    1.263687          0   6.641627
      PUBRES |      2,324    .0671256    .2502933          0          1
             |
     HRIGHTS |
         D1. |      2,324    .0122286    .7335036         -3          3
         L1. |      2,324    2.785247    1.087682          1          5
             |
       CIVIL |
         D1. |      2,324   -.0223752    .5737989         -4          4
-------------+---------------------------------------------------------
         L1. |      2,324    4.692341    1.501473          1          7
             |
      GDPPOP |
         L1. |      2,324    6.728779    1.190204   3.899875   10.45537
             |
       LNPOP |
         L1. |      2,324     15.8313    1.596135   12.20617   20.96228
             |
     USAGREE |
         L1. |      2,324    .3541963    .1212851          0   .8535354
             |
         WAR |      2,324    .2710843    .4446152          0          1
-------------+---------------------------------------------------------
       CAPAB |      2,324    .0233268    .0765221   .0001196   .7338794
      linear |      2,324    2.000861    13.79045        -22         24
        quad |      2,324    192.0981    173.9297         -2        574

. 
. * how many countries are condemned in the window of this model?
. unique CCODE if e(sample) & PUBRES == 1
Number of unique values of CCODE is  26
Number of records is  156

. 
. * with interaction
. eststo lvinteract: xtreg BIPOP l.BIPOP PUBRES RESxBI d.HRIGHTS l.HRIGHTS d.CIVIL l.CIVIL l.GDPPOP l.LNPOP l.USAGREE WAR CAPAB linear quad , mle i(CCODE) nolog

Random-effects ML regression                    Number of obs     =      2,324
Group variable: CCODE                           Number of groups  =        118

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          4
                                                              avg =       19.7
                                                              max =         24

                                                LR chi2(14)       =    1121.35
Log likelihood  = -1784.2318                    Prob > chi2       =     0.0000

------------------------------------------------------------------------------
       BIPOP |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       BIPOP |
         L1. |   .5393435   .0220557    24.45   0.000     .4961151     .582572
             |
      PUBRES |  -.3915769   .1165565    -3.36   0.001    -.6200236   -.1631303
      RESxBI |    .135775   .0376933     3.60   0.000     .0618975    .2096526
             |
     HRIGHTS |
         D1. |  -.0381467   .0168218    -2.27   0.023    -.0711168   -.0051765
         L1. |  -.0190818   .0181837    -1.05   0.294    -.0547212    .0165576
             |
       CIVIL |
         D1. |  -.0150284    .019339    -0.78   0.437    -.0529322    .0228754
         L1. |  -.0193268   .0127157    -1.52   0.129    -.0442491    .0055955
             |
      GDPPOP |
         L1. |  -.1172656   .0249919    -4.69   0.000    -.1662488   -.0682824
             |
       LNPOP |
         L1. |  -.1591242   .0305147    -5.21   0.000    -.2189319   -.0993165
             |
     USAGREE |
         L1. |  -.1449524   .1442668    -1.00   0.315      -.42771    .1378053
             |
         WAR |  -.0973669   .0344458    -2.83   0.005    -.1648793   -.0298544
       CAPAB |  -.8385162   .5949652    -1.41   0.159    -2.004627    .3275942
      linear |  -.0049166   .0011088    -4.43   0.000    -.0070898   -.0027433
        quad |  -.0000377   .0000853    -0.44   0.658    -.0002049    .0001295
       _cons |    4.97119   .5579108     8.91   0.000     3.877705    6.064675
-------------+----------------------------------------------------------------
    /sigma_u |   .3770135      .0377                      .3099131    .4586421
    /sigma_e |    .489726   .0075537                      .4751427     .504757
         rho |   .3721206   .0484517                      .2818713    .4700306
------------------------------------------------------------------------------
LR test of sigma_u=0: chibar2(01) = 110.90             Prob >= chibar2 = 0.000

. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
  lvinteract |      2,324 -2344.908  -1784.232      17    3602.464   3700.231
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. mat icsto = r(S)

. scalar aicsto = icsto[1,5]

. scalar bicsto = icsto[1,6]

. estadd scalar AIC = aicsto: lvinteract

. estadd scalar BIC = bicsto: lvinteract

. 
. unique CCODE if e(sample)
Number of unique values of CCODE is  118
Number of records is  2324

. estadd scalar countries = r(sum): lvinteract

. 
. tab YEAR if e(sample)

       year |      Freq.     Percent        Cum.
------------+-----------------------------------
       1979 |         82        3.53        3.53
       1980 |         84        3.61        7.14
       1981 |         89        3.83       10.97
       1982 |         90        3.87       14.85
       1983 |         90        3.87       18.72
       1984 |         90        3.87       22.59
       1985 |         91        3.92       26.51
       1986 |         95        4.09       30.59
       1987 |         95        4.09       34.68
       1988 |         95        4.09       38.77
       1989 |         97        4.17       42.94
       1990 |         97        4.17       47.12
       1991 |         98        4.22       51.33
       1992 |         94        4.04       55.38
       1993 |         94        4.04       59.42
       1994 |         99        4.26       63.68
       1995 |         99        4.26       67.94
       1996 |        105        4.52       72.46
       1997 |        106        4.56       77.02
       1998 |        108        4.65       81.67
       1999 |        108        4.65       86.32
       2000 |        106        4.56       90.88
       2001 |        106        4.56       95.44
       2002 |        106        4.56      100.00
------------+-----------------------------------
      Total |      2,324      100.00

. 
. esttab lvrep lvinteract using "bipop.tex", longtable title("State-dependence in Aggregate Bilateral Aid Flows, UNCHR Resolution Shaming Measure*\label{tab:LV}") replac
> e order(L.BIPOP PUBRES RESxBI D.HRIGHTS L.HRIGHTS D.CIVIL L.CIVIL L.GDPPOP L.LNPOP L.USAGREE WAR CAPAB linear quad) keep(L.BIPOP PUBRES RESxBI D.HRIGHTS L.HRIGHTS D.CI
> VIL L.CIVIL L.GDPPOP L.LNPOP L.USAGREE WAR CAPAB linear quad) eqlabels(,none) nomtitles nodepvars coeflabels(L.BIPOP "DV\$_{i(t-1)}$" PUBRES "UNCHR Resolution\$\_{i(t-
> 1)}$" RESxBI "DV\$_{i(t-1)}$ * UNCHR Res\$\_{i(t-1)}$" L.USAGREE "Agreement with USA\$\_{i(t-1)}$" D.HRIGHTS "\$\Delta$ Personal Integrity Abuse" L.HRIGHTS "Personal I
> ntegrity Abuse\$\_{i(t-1)}$" D.CIVIL "\$\Delta$ Civil Liberties" L.CIVIL "Civil Liberties\$\_{i(t-1)}$" L.GDPPOP "ln GDP per capita\$\_{i(t-1)}$" L.LNPOP "ln populatio
> n\$\_{i(t-1)}$" WAR "War\$\_{i(t-1)}$" CAPAB "Capabilities\$\_{i(t-1)}$" linear "Time (linear)" quad "Time (quadratic)") noabbrev wrap gaps varwidth(45) align(r) subst
> itute(\_ _) stats(N countries blank AIC BIC, labels("Observations" "Recipients" " " "AIC" "BIC"))
(output written to bipop.tex)

. 
. 
. * try other Lebovic/Voeten dependent variables
. 
. xtreg MUPOP l.MUPOP PUBRES d.HRIGHTS l.HRIGHTS d.CIVIL l.CIVIL l.GDPPOP l.LNPOP l.USAGREE WAR CAPAB linear quad , mle i(CCODE) nolog

Random-effects ML regression                    Number of obs     =      2,308
Group variable: CCODE                           Number of groups  =        118

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          4
                                                              avg =       19.6
                                                              max =         24

                                                LR chi2(13)       =     767.39
Log likelihood  = -2471.1142                    Prob > chi2       =     0.0000

------------------------------------------------------------------------------
       MUPOP |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       MUPOP |
         L1. |   .4367646   .0225663    19.35   0.000     .3925355    .4809937
             |
      PUBRES |  -.3008741   .0782794    -3.84   0.000    -.4542989   -.1474494
             |
     HRIGHTS |
         D1. |   .0162832   .0230227     0.71   0.479    -.0288404    .0614069
         L1. |   .0165686   .0241696     0.69   0.493    -.0308029    .0639401
             |
       CIVIL |
         D1. |   .0026293    .026404     0.10   0.921    -.0491216    .0543803
         L1. |  -.0187643    .016105    -1.17   0.244    -.0503294    .0128009
             |
      GDPPOP |
         L1. |  -.3296394   .0281342   -11.72   0.000    -.3847814   -.2744975
             |
       LNPOP |
         L1. |  -.2983065   .0306674    -9.73   0.000    -.3584135   -.2381994
             |
     USAGREE |
         L1. |   .2607768    .191514     1.36   0.173    -.1145839    .6361374
             |
         WAR |  -.1098564   .0462394    -2.38   0.018    -.2004839   -.0192289
       CAPAB |   .0963824   .5620555     0.17   0.864    -1.005226    1.197991
      linear |  -.0026737   .0014123    -1.89   0.058    -.0054418    .0000945
        quad |  -.0002954   .0001175    -2.51   0.012    -.0005257    -.000065
       _cons |   8.287547    .588702    14.08   0.000     7.133713    9.441382
-------------+----------------------------------------------------------------
    /sigma_u |   .3271535   .0360207                      .2636522    .4059492
    /sigma_e |   .6764961   .0104381                      .6563441    .6972669
         rho |   .1895411    .034946                      .1287405    .2653912
------------------------------------------------------------------------------
LR test of sigma_u=0: chibar2(01) = 98.87              Prob >= chibar2 = 0.000

. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |      2,308 -2854.807  -2471.114      16    4974.228   5066.135
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. 
. xtreg MUPOP l.MUPOP PUBRES RESxMU d.HRIGHTS l.HRIGHTS d.CIVIL l.CIVIL l.GDPPOP l.LNPOP l.USAGREE WAR CAPAB linear quad , mle i(CCODE) nolog

Random-effects ML regression                    Number of obs     =      2,308
Group variable: CCODE                           Number of groups  =        118

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          4
                                                              avg =       19.6
                                                              max =         24

                                                LR chi2(14)       =     767.78
Log likelihood  = -2470.9184                    Prob > chi2       =     0.0000

------------------------------------------------------------------------------
       MUPOP |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       MUPOP |
         L1. |   .4333131   .0232151    18.67   0.000     .3878124    .4788138
             |
      PUBRES |  -.3557852   .1176389    -3.02   0.002    -.5863532   -.1252171
      RESxMU |   .0305092   .0487718     0.63   0.532    -.0650818    .1261003
             |
     HRIGHTS |
         D1. |   .0157083   .0230374     0.68   0.495    -.0294442    .0608608
         L1. |   .0161977   .0241828     0.67   0.503    -.0311998    .0635952
             |
       CIVIL |
         D1. |   .0030586    .026411     0.12   0.908    -.0487061    .0548232
         L1. |  -.0182082     .01615    -1.13   0.260    -.0498616    .0134451
             |
      GDPPOP |
         L1. |  -.3298996   .0282119   -11.69   0.000     -.385194   -.2746052
             |
       LNPOP |
         L1. |  -.2981277   .0307569    -9.69   0.000      -.35841   -.2378453
             |
     USAGREE |
         L1. |   .2607181   .1915373     1.36   0.173    -.1146882    .6361243
             |
         WAR |  -.1104004   .0462517    -2.39   0.017    -.2010521   -.0197487
       CAPAB |   .0805995   .5648947     0.14   0.887    -1.026574    1.187773
      linear |  -.0027041   .0014137    -1.91   0.056     -.005475    .0000667
        quad |  -.0002943   .0001175    -2.50   0.012    -.0005246   -.0000639
       _cons |   8.293568   .5899843    14.06   0.000      7.13722    9.449916
-------------+----------------------------------------------------------------
    /sigma_u |    .328863   .0362109                      .2650268    .4080752
    /sigma_e |   .6762866    .010437                      .6561367    .6970552
         rho |   .1912434   .0351908                      .1299818     .267573
------------------------------------------------------------------------------
LR test of sigma_u=0: chibar2(01) = 99.21              Prob >= chibar2 = 0.000

. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |      2,308 -2854.807  -2470.918      17    4975.837   5073.487
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. 
. xtreg WBPOP l.WBPOP PUBRES d.HRIGHTS l.HRIGHTS d.CIVIL l.CIVIL l.GDPPOP l.LNPOP l.USAGREE WAR CAPAB linear quad , mle i(CCODE) nolog

Random-effects ML regression                    Number of obs     =      1,548
Group variable: CCODE                           Number of groups  =         84

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          4
                                                              avg =       18.4
                                                              max =         24

                                                LR chi2(13)       =     126.33
Log likelihood  = -2194.2968                    Prob > chi2       =     0.0000

------------------------------------------------------------------------------
       WBPOP |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       WBPOP |
         L1. |   .1673054   .0277196     6.04   0.000      .112976    .2216347
             |
      PUBRES |  -.4229326   .1401918    -3.02   0.003    -.6977035   -.1481618
             |
     HRIGHTS |
         D1. |  -.0181264   .0394037    -0.46   0.646    -.0953562    .0591035
         L1. |  -.0407364   .0422792    -0.96   0.335     -.123602    .0421293
             |
       CIVIL |
         D1. |     .00358   .0444191     0.08   0.936    -.0834798    .0906398
         L1. |   .0418466   .0280123     1.49   0.135    -.0130565    .0967497
             |
      GDPPOP |
         L1. |  -.4745161   .0617326    -7.69   0.000    -.5955099   -.3535223
             |
       LNPOP |
         L1. |  -.0887938   .0481069    -1.85   0.065    -.1830815    .0054939
             |
     USAGREE |
         L1. |   1.109969   .3419468     3.25   0.001     .4397655    1.780172
             |
         WAR |  -.2185425   .0788516    -2.77   0.006    -.3730889   -.0639961
       CAPAB |  -1.130697   .8314083    -1.36   0.174    -2.760227    .4988338
      linear |    .010531   .0025287     4.16   0.000     .0055749    .0154871
        quad |  -.0006178   .0002005    -3.08   0.002    -.0010107    -.000225
       _cons |   5.122285   .9068218     5.65   0.000     3.344947    6.899623
-------------+----------------------------------------------------------------
    /sigma_u |   .4624325   .0547106                      .3667264    .5831153
    /sigma_e |     .95583    .017882                      .9214168    .9915285
         rho |   .1896695    .037543                       .124956    .2717043
------------------------------------------------------------------------------
LR test of sigma_u=0: chibar2(01) = 90.26              Prob >= chibar2 = 0.000

. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |      1,548 -2257.464  -2194.297      16    4420.594   4506.109
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. 
. xtreg WBPOP l.WBPOP PUBRES RESxWB d.HRIGHTS l.HRIGHTS d.CIVIL l.CIVIL l.GDPPOP l.LNPOP l.USAGREE WAR CAPAB linear quad , mle i(CCODE) nolog

Random-effects ML regression                    Number of obs     =      1,548
Group variable: CCODE                           Number of groups  =         84

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          4
                                                              avg =       18.4
                                                              max =         24

                                                LR chi2(14)       =     127.29
Log likelihood  = -2193.8188                    Prob > chi2       =     0.0000

------------------------------------------------------------------------------
       WBPOP |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       WBPOP |
         L1. |   .1613212   .0283272     5.69   0.000      .105801    .2168414
             |
      PUBRES |  -.4745986   .1499369    -3.17   0.002    -.7684696   -.1807276
      RESxWB |   .0980491   .1002435     0.98   0.328    -.0984246    .2945227
             |
     HRIGHTS |
         D1. |   -.018079   .0393849    -0.46   0.646    -.0952719    .0591139
         L1. |  -.0410837    .042294    -0.97   0.331    -.1239784    .0418111
             |
       CIVIL |
         D1. |   .0051851   .0444237     0.12   0.907    -.0818837    .0922539
         L1. |   .0434162   .0281033     1.54   0.122    -.0116653    .0984977
             |
      GDPPOP |
         L1. |  -.4696029   .0622611    -7.54   0.000    -.5916325   -.3475733
             |
       LNPOP |
         L1. |  -.0861745   .0486149    -1.77   0.076     -.181458    .0091091
             |
     USAGREE |
         L1. |   1.105523   .3420898     3.23   0.001     .4350395    1.776007
             |
         WAR |  -.2246028   .0790897    -2.84   0.005    -.3796157   -.0695899
       CAPAB |   -1.17344   .8407609    -1.40   0.163    -2.821301    .4744215
      linear |   .0104615   .0025323     4.13   0.000     .0054982    .0154247
        quad |  -.0006207   .0002004    -3.10   0.002    -.0010135    -.000228
       _cons |    5.05676   .9161975     5.52   0.000     3.261046    6.852474
-------------+----------------------------------------------------------------
    /sigma_u |   .4683363   .0553601                      .3714846    .5904387
    /sigma_e |   .9549817   .0178727                      .9205865    .9906619
         rho |   .1938772   .0381513                      .1280071    .2770821
------------------------------------------------------------------------------
LR test of sigma_u=0: chibar2(01) = 90.96              Prob >= chibar2 = 0.000

. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
           . |      1,548 -2257.464  -2193.819      17    4421.638   4512.498
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. 
. 
. 
. 
. 
. merge m:1 CCODE YEAR using murdie_merge.dta
(note: variable YEAR was int, now double to accommodate using data's values)
(note: variable CCODE was int, now float to accommodate using data's values)

    Result                           # of obs.
    -----------------------------------------
    not matched                         4,563
        from master                         0  (_merge==1)
        from using                      4,563  (_merge==2)

    matched                             3,577  (_merge==3)
    -----------------------------------------

. drop _merge

. 
. tsset CCODE YEAR
       panel variable:  CCODE (unbalanced)
        time variable:  YEAR, 1976 to 2008
                delta:  1 unit

. 
. 
. eststo ngoplain: xtreg BIPOP l.BIPOP L.HRnc2gcnc2 d.HRIGHTS l.HRIGHTS d.CIVIL l.CIVIL l.GDPPOP l.LNPOP l.USAGREE WAR CAPAB linear quad , mle i(CCODE) nolog

Random-effects ML regression                    Number of obs     =        989
Group variable: CCODE                           Number of groups  =        112

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          1
                                                              avg =        8.8
                                                              max =         10

                                                LR chi2(13)       =     159.28
Log likelihood  = -748.70148                    Prob > chi2       =     0.0000

------------------------------------------------------------------------------
       BIPOP |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       BIPOP |
         L1. |   .8062606   .0190424    42.34   0.000     .7689382     .843583
             |
  HRnc2gcnc2 |
         L1. |  -.0138895   .0168788    -0.82   0.411    -.0469713    .0191924
             |
     HRIGHTS |
         D1. |   .0222006   .0251108     0.88   0.377    -.0270157    .0714169
         L1. |     .03106     .02307     1.35   0.178    -.0141564    .0762763
             |
       CIVIL |
         D1. |  -.0501806   .0272207    -1.84   0.065    -.1035322     .003171
         L1. |  -.0355718   .0134651    -2.64   0.008     -.061963   -.0091806
             |
      GDPPOP |
         L1. |  -.0826475   .0172518    -4.79   0.000    -.1164605   -.0488346
             |
       LNPOP |
         L1. |  -.0614567   .0162506    -3.78   0.000    -.0933072   -.0296062
             |
     USAGREE |
         L1. |   .1450681   .2160433     0.67   0.502     -.278369    .5685052
             |
         WAR |  -.0834671   .0472918    -1.76   0.078    -.1761574    .0092231
       CAPAB |  -.3150339   .2586424    -1.22   0.223    -.8219637    .1918959
      linear |  -.0150794   .0202898    -0.74   0.457    -.0548466    .0246879
        quad |   .0005797    .000646     0.90   0.370    -.0006864    .0018457
       _cons |    2.20945   .3783895     5.84   0.000      1.46782     2.95108
-------------+----------------------------------------------------------------
    /sigma_u |          0   .1218683                             .           .
    /sigma_e |   .5158652   .0115991                      .4936251    .5391074
         rho |          0  (omitted)
------------------------------------------------------------------------------
LR test of sigma_u=0: chibar2(01) = 0.00               Prob >= chibar2 = 1.000

. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
    ngoplain |        989 -828.3396  -748.7015      16    1529.403    1607.75
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. mat icsto = r(S)

. scalar aicsto = icsto[1,5]

. scalar bicsto = icsto[1,6]

. estadd scalar AIC = aicsto: ngoplain

. estadd scalar BIC = bicsto: ngoplain

. 
. unique CCODE if e(sample)
Number of unique values of CCODE is  112
Number of records is  989

. estadd scalar countries = r(sum): ngoplain

. 
. 
. gen lagXngo = l.HRnc2gcnc2*l.BIPOP
(6,855 missing values generated)

. eststo ngoreg: xtreg BIPOP l.BIPOP L.HRnc2gcnc2 lagXngo d.HRIGHTS l.HRIGHTS d.CIVIL l.CIVIL l.GDPPOP l.LNPOP l.USAGREE WAR CAPAB linear quad , mle i(CCODE) nolog

Random-effects ML regression                    Number of obs     =        989
Group variable: CCODE                           Number of groups  =        112

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          1
                                                              avg =        8.8
                                                              max =         10

                                                LR chi2(14)       =     159.54
Log likelihood  =  -748.5683                    Prob > chi2       =     0.0000

------------------------------------------------------------------------------
       BIPOP |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       BIPOP |
         L1. |   .8046819    .019284    41.73   0.000      .766886    .8424778
             |
  HRnc2gcnc2 |
         L1. |  -.0320947   .0391018    -0.82   0.412    -.1087329    .0445434
             |
     lagXngo |   .0072256   .0139994     0.52   0.606    -.0202128    .0346639
             |
     HRIGHTS |
         D1. |   .0216091   .0251336     0.86   0.390    -.0276518      .07087
         L1. |   .0306475   .0230807     1.33   0.184    -.0145898    .0758849
             |
       CIVIL |
         D1. |  -.0503545   .0272191    -1.85   0.064     -.103703     .002994
         L1. |  -.0353912   .0134679    -2.63   0.009    -.0617877   -.0089947
             |
      GDPPOP |
         L1. |  -.0825654   .0172502    -4.79   0.000    -.1163753   -.0487556
             |
       LNPOP |
         L1. |  -.0613656   .0162493    -3.78   0.000    -.0932137   -.0295174
             |
     USAGREE |
         L1. |   .1392108   .2163121     0.64   0.520    -.2847531    .5631747
             |
         WAR |  -.0839501   .0472947    -1.78   0.076    -.1766461    .0087458
       CAPAB |  -.2910861   .2627369    -1.11   0.268     -.806041    .2238688
      linear |  -.0146597   .0203033    -0.72   0.470    -.0544535     .025134
        quad |   .0005668   .0006463     0.88   0.381       -.0007    .0018336
       _cons |   2.211212    .378354     5.84   0.000     1.469652    2.952772
-------------+----------------------------------------------------------------
    /sigma_u |          0   .1103274                             .           .
    /sigma_e |   .5157958   .0115975                      .4935587    .5390348
         rho |          0  (omitted)
------------------------------------------------------------------------------
LR test of sigma_u=0: chibar2(01) = 0.00               Prob >= chibar2 = 1.000

. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
      ngoreg |        989 -828.3396  -748.5683      17    1531.137    1614.38
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. mat icsto = r(S)

. scalar aicsto = icsto[1,5]

. scalar bicsto = icsto[1,6]

. estadd scalar AIC = aicsto: ngoreg

. estadd scalar BIC = bicsto: ngoreg

. 
. 
. tab YEAR if e(sample)

       year |      Freq.     Percent        Cum.
------------+-----------------------------------
       1993 |         86        8.70        8.70
       1994 |         96        9.71       18.40
       1995 |         94        9.50       27.91
       1996 |        100       10.11       38.02
       1997 |        101       10.21       48.23
       1998 |        103       10.41       58.65
       1999 |        102       10.31       68.96
       2000 |        101       10.21       79.17
       2001 |        101       10.21       89.38
       2002 |        105       10.62      100.00
------------+-----------------------------------
      Total |        989      100.00

. 
. unique CCODE if e(sample)
Number of unique values of CCODE is  112
Number of records is  989

. estadd scalar countries = r(sum): ngoreg

. 
. gen ngodum = .
(8,140 missing values generated)

. replace ngodum = 1 if l.HRnc2gcnc2>=1 & l.HRnc2gcnc2!=.
(249 real changes made)

. replace ngodum = 0 if l.HRnc2gcnc2<1 & l.HRnc2gcnc2!=.
(3,429 real changes made)

. 
. eststo ngoplain2: xtreg BIPOP l.BIPOP ngodum d.HRIGHTS l.HRIGHTS d.CIVIL l.CIVIL l.GDPPOP l.LNPOP l.USAGREE WAR CAPAB linear quad , mle i(CCODE) nolog

Random-effects ML regression                    Number of obs     =        989
Group variable: CCODE                           Number of groups  =        112

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          1
                                                              avg =        8.8
                                                              max =         10

                                                LR chi2(13)       =     158.64
Log likelihood  = -749.02065                    Prob > chi2       =     0.0000

------------------------------------------------------------------------------
       BIPOP |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       BIPOP |
         L1. |   .8056989   .0190455    42.30   0.000     .7683705    .8430274
             |
      ngodum |    .011448   .0582786     0.20   0.844    -.1027759    .1256719
             |
     HRIGHTS |
         D1. |   .0224804   .0251395     0.89   0.371    -.0267922     .071753
         L1. |   .0297933   .0231667     1.29   0.198    -.0156127    .0751993
             |
       CIVIL |
         D1. |   -.049826   .0272285    -1.83   0.067    -.1031929     .003541
         L1. |  -.0368543   .0134751    -2.73   0.006    -.0632651   -.0104436
             |
      GDPPOP |
         L1. |  -.0840768   .0172559    -4.87   0.000    -.1178978   -.0502557
             |
       LNPOP |
         L1. |  -.0619787   .0162798    -3.81   0.000    -.0938865    -.030071
             |
     USAGREE |
         L1. |   .1530493   .2159436     0.71   0.478    -.2701924    .5762911
             |
         WAR |  -.0863971   .0472139    -1.83   0.067    -.1789345    .0061404
       CAPAB |  -.3461031   .2587525    -1.34   0.181    -.8532488    .1610425
      linear |  -.0144961   .0202992    -0.71   0.475    -.0542817    .0252895
        quad |   .0005371   .0006462     0.83   0.406    -.0007294    .0018036
       _cons |   2.234676   .3793388     5.89   0.000     1.491186    2.978166
-------------+----------------------------------------------------------------
    /sigma_u |          0   .1229361                             .           .
    /sigma_e |   .5160317   .0116028                      .4937845    .5392814
         rho |          0  (omitted)
------------------------------------------------------------------------------
LR test of sigma_u=0: chibar2(01) = 0.00               Prob >= chibar2 = 1.000

. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
   ngoplain2 |        989 -828.3396  -749.0207      16    1530.041   1608.388
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. mat icsto = r(S)

. scalar aicsto = icsto[1,5]

. scalar bicsto = icsto[1,6]

. estadd scalar AIC = aicsto: ngoplain2

. estadd scalar BIC = bicsto: ngoplain2

. 
. unique CCODE if e(sample)
Number of unique values of CCODE is  112
Number of records is  989

. estadd scalar countries = r(sum): ngoplain2

. 
. 
. gen lagXngodum = ngodum*l.BIPOP
(6,855 missing values generated)

. eststo ngoreg2: xtreg BIPOP l.BIPOP ngodum lagXngodum d.HRIGHTS l.HRIGHTS d.CIVIL l.CIVIL l.GDPPOP l.LNPOP l.USAGREE WAR CAPAB linear quad , mle i(CCODE) nolog

Random-effects ML regression                    Number of obs     =        989
Group variable: CCODE                           Number of groups  =        112

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          1
                                                              avg =        8.8
                                                              max =         10

                                                LR chi2(14)       =     158.66
Log likelihood  = -749.00958                    Prob > chi2       =     0.0000

------------------------------------------------------------------------------
       BIPOP |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
       BIPOP |
         L1. |   .8064331   .0196739    40.99   0.000      .767873    .8449932
             |
      ngodum |   .0276839   .1236952     0.22   0.823    -.2147543    .2701221
  lagXngodum |  -.0065313   .0438909    -0.15   0.882    -.0925559    .0794933
             |
     HRIGHTS |
         D1. |   .0226509   .0251653     0.90   0.368    -.0266723     .071974
         L1. |   .0299193    .023182     1.29   0.197    -.0155165    .0753551
             |
       CIVIL |
         D1. |  -.0497529   .0272327    -1.83   0.068    -.1031279    .0036222
         L1. |  -.0368072   .0134787    -2.73   0.006    -.0632249   -.0103894
             |
      GDPPOP |
         L1. |  -.0839125    .017291    -4.85   0.000    -.1178023   -.0500228
             |
       LNPOP |
         L1. |  -.0619876   .0162797    -3.81   0.000    -.0938952     -.03008
             |
     USAGREE |
         L1. |   .1549029   .2163002     0.72   0.474    -.2690377    .5788435
             |
         WAR |  -.0860983    .047256    -1.82   0.068    -.1787184    .0065218
       CAPAB |   -.353622   .2636369    -1.34   0.180    -.8703408    .1630967
      linear |  -.0146084   .0203129    -0.72   0.472     -.054421    .0252043
        quad |   .0005405   .0006466     0.84   0.403    -.0007267    .0018078
       _cons |   2.231188    .380058     5.87   0.000     1.486288    2.976088
-------------+----------------------------------------------------------------
    /sigma_u |          0   .1249078                             .           .
    /sigma_e |    .516026   .0116027                      .4937789    .5392753
         rho |          0  (omitted)
------------------------------------------------------------------------------
LR test of sigma_u=0: chibar2(01) = 0.00               Prob >= chibar2 = 1.000

. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
     ngoreg2 |        989 -828.3396  -749.0096      17    1532.019   1615.263
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. mat icsto = r(S)

. scalar aicsto = icsto[1,5]

. scalar bicsto = icsto[1,6]

. estadd scalar AIC = aicsto: ngoreg2

. estadd scalar BIC = bicsto: ngoreg2

. 
. unique CCODE if e(sample)
Number of unique values of CCODE is  112
Number of records is  989

. estadd scalar countries = r(sum): ngoreg2

. 
. 
. esttab ngoplain ngoreg ngoplain2 ngoreg2 using "ngo-bipop.tex", longtable title("State-dependence in Aggregate Bilateral Aid Flows, Murdie et al. (2012) NGO Shaming Me
> asure*\label{tab:ngo-appendix}") replace order(L.BIPOP L.HRnc2gcnc2 lagXngo ngodum lagXngodum D.HRIGHTS L.HRIGHTS D.CIVIL L.CIVIL L.GDPPOP L.LNPOP L.USAGREE WAR CAPAB 
> linear quad) keep(L.BIPOP L.HRnc2gcnc2 lagXngo ngodum lagXngodum  D.HRIGHTS L.HRIGHTS D.CIVIL L.CIVIL L.GDPPOP L.LNPOP L.USAGREE WAR CAPAB linear quad) eqlabels(,none)
>  nomtitles nodepvars coeflabels(L.BIPOP "DV\$_{i(t-1)}$" L.HRnc2gcnc2 "NGO Shaming\$\_{i(t-1)}$" lagXngo "DV\$_{i(t-1)}$ * NGO Shaming\$\_{i(t-1)}$" ngodum "NGO Shamin
> g\$\_{i(t-1)} \geq 1$" lagXngodum "DV\$_{i(t-1)}$ * NGO Shaming\$\_{i(t-1)} \geq 1$" L.USAGREE "Agreement with USA\$\_{i(t-1)}$" D.HRIGHTS "\$\Delta$ Personal Integrit
> y Abuse" L.HRIGHTS "Personal Integrity Abuse\$\_{i(t-1)}$" D.CIVIL "\$\Delta$ Civil Liberties" L.CIVIL "Civil Liberties\$\_{i(t-1)}$" L.GDPPOP "ln GDP per capita\$\_{i
> (t-1)}$" L.LNPOP "ln population\$\_{i(t-1)}$" WAR "War\$\_{i(t-1)}$" CAPAB "Capabilities\$\_{i(t-1)}$" linear "Time (linear)" quad "Time (quadratic)") noabbrev wrap ga
> ps varwidth(50) align(r) substitute(\_ _) stats(N countries blank AIC BIC, labels("Observations" "Recipients" " " "AIC" "BIC"))
(output written to ngo-bipop.tex)

. 
. 
. *********************************************
. * run R code in order to create R figures
. *********************************************
. 
. * prepare the data
. use jprworkdatanew, clear

. 
. quietly{

. 
. saveold jprworkdatanewMOD, replace version(12)
(saving in Stata 12 format, which can be read by Stata 11 or 12)
file jprworkdatanewMOD.dta saved

. 
. shell R CMD BATCH 2016-4-3_figure-construction.r

. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. * determine out of sample forecasting fit
. * for esarey-demeritt model #3
. 
. clear all

. set more off

. set matsize 800

. 
. 
. ** merge in public resolution data
. use jprworkdatanew.dta, clear

. rename YEAR year 

. rename CCODE countrynumcode_g

. save jpr_merge.dta, replace
file jpr_merge.dta saved

. 
. use "dat2.dta", clear

. 
. merge m:1 year countrynumcode_g year using jpr_merge.dta

    Result                           # of obs.
    -----------------------------------------
    not matched                        51,079
        from master                    50,316  (_merge==1)
        from using                        763  (_merge==2)

    matched                            69,741  (_merge==3)
    -----------------------------------------

. drop if _merge==2
(763 observations deleted)

. 
. tsset dyadnum year
       panel variable:  dyadnum (unbalanced)
        time variable:  year, 1980 to 2006, but with gaps
                delta:  1 unit

. 
. gen allXpub = PUBRES*l.alliance
(66,759 missing values generated)

. gen neiXpub = PUBRES*l.donorallyneighbor2
(66,633 missing values generated)

. gen s3unXpub = PUBRES*l.s3un
(66,693 missing values generated)

. 
. gen lagXpub = PUBRES*l.lneconaidpc
(66,864 missing values generated)

. 
. 
. * generate lag variables to enable setting initial values
. * for the xttobit model
. gen lagphysint = l.physint 
(41,727 missing values generated)

. gen lagalliance = l.alliance 
(37,968 missing values generated)

. gen lagdonorallyneighbor2 = l.donorallyneighbor2 
(11,109 missing values generated)

. gen lags3un = l.s3un 
(25,446 missing values generated)

. gen laglnreftotal = l.lnreftotal 
(22,113 missing values generated)

. gen laglnnytimes = l.lnnytimes 
(60,249 missing values generated)

. gen lagratpercent = l.ratpercent 
(6,552 missing values generated)

. gen lagdonor_physint = l.donor_physint 
(10,437 missing values generated)

. gen lagpolity2 = l.polity2 
(38,766 missing values generated)

. gen laglneconaidpc = l.lneconaidpc 
(35,910 missing values generated)

. gen lagln_rgdpc = l.ln_rgdpc 
(35,910 missing values generated)

. gen lagln_population = l.ln_population 
(35,910 missing values generated)

. gen lagln_trade = l.ln_trade 
(40,084 missing values generated)

. gen lagwar = l.war
(29,862 missing values generated)

. 
. * use paper model to generate initial values
. xttobit lneconaidpc PUBRES lagXpub lagphysint lagalliance allXpub lagdonorallyneighbor2 neiXpub lags3un s3unXpub laglnreftotal laglnnytimes lagratpercent lagdonor_phys
> int lagpolity2 laglneconaidpc lnworldaidecon lagln_rgdpc lagln_population lagln_trade dyad_colony socialist ColdWar coldwarsoc lagwar region_SSA region_Latin region_ME
> NA region_EAsiaPac if(inmysample==1), ll(0) intpoints(19)

Obtaining starting values for full model:

Iteration 0:   log likelihood = -72998.195
Iteration 1:   log likelihood = -71839.746
Iteration 2:   log likelihood =  -71717.73
Iteration 3:   log likelihood = -71715.747
Iteration 4:   log likelihood = -71715.745

Fitting full model:

Iteration 0:   log likelihood = -53498.415  
Iteration 1:   log likelihood = -47379.683  
Iteration 2:   log likelihood = -44825.043  
Iteration 3:   log likelihood = -44546.905  
Iteration 4:   log likelihood = -44484.873  
Iteration 5:   log likelihood = -44484.716  
Iteration 6:   log likelihood = -44484.716  

Random-effects tobit regression                 Number of obs     =     35,234
Group variable: dyadnum                         Number of groups  =      2,088

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          1
                                                              avg =       16.9
                                                              max =         21

Integration method: mvaghermite                 Integration pts.  =         19

                                                Wald chi2(28)     =    4583.90
Log likelihood  = -44484.716                    Prob > chi2       =     0.0000

---------------------------------------------------------------------------------------
          lneconaidpc |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
----------------------+----------------------------------------------------------------
               PUBRES |  -1.631501   .2271224    -7.18   0.000    -2.076653   -1.186349
              lagXpub |    .249288   .0336464     7.41   0.000     .1833423    .3152337
           lagphysint |  -.0651764   .0161501    -4.04   0.000    -.0968299   -.0335228
          lagalliance |   .3999087    .206346     1.94   0.053     -.004522    .8043394
              allXpub |   .2111684   .6331185     0.33   0.739    -1.029721    1.452058
lagdonorallyneighbor2 |  -.0931887   .2070363    -0.45   0.653    -.4989723     .312595
              neiXpub |   .8243034   .2651802     3.11   0.002     .3045597    1.344047
              lags3un |  -.2129083   .1778304    -1.20   0.231    -.5614495     .135633
             s3unXpub |   1.394296   .4392446     3.17   0.002     .5333922    2.255199
        laglnreftotal |   .0468388   .0132568     3.53   0.000     .0208559    .0728217
         laglnnytimes |  -.0983577   .0321863    -3.06   0.002    -.1614416   -.0352737
        lagratpercent |  -.2809451   .1521571    -1.85   0.065    -.5791674    .0172773
     lagdonor_physint |  -.0236525   .0337481    -0.70   0.483    -.0897976    .0424926
           lagpolity2 |   .0324518   .0059527     5.45   0.000     .0207847    .0441189
       laglneconaidpc |   .3855218   .0104294    36.96   0.000     .3650806    .4059631
       lnworldaidecon |    .977431    .033611    29.08   0.000     .9115548    1.043307
          lagln_rgdpc |  -.3346536   .0838636    -3.99   0.000    -.4990232    -.170284
     lagln_population |   .4507121   .0558918     8.06   0.000     .3411661    .5602581
          lagln_trade |   .0771671    .010194     7.57   0.000     .0571872    .0971471
          dyad_colony |   1.859173   .3712635     5.01   0.000     1.131509    2.586836
            socialist |  -.6207941   .2020181    -3.07   0.002    -1.016742   -.2248459
              ColdWar |  -.0415851   .0796658    -0.52   0.602    -.1977273     .114557
           coldwarsoc |   1.093002   .1189901     9.19   0.000     .8597857    1.326218
               lagwar |  -.0635809   .0759069    -0.84   0.402    -.2123556    .0851939
           region_SSA |   .9223899   .2444348     3.77   0.000     .4433064    1.401473
         region_Latin |   .1992656    .251386     0.79   0.428    -.2934418     .691973
          region_MENA |  -1.576247   .2937745    -5.37   0.000    -2.152034    -1.00046
      region_EAsiaPac |   .1336258   .2611606     0.51   0.609    -.3782395    .6454912
                _cons |  -22.33322   1.221944   -18.28   0.000    -24.72819   -19.93826
----------------------+----------------------------------------------------------------
             /sigma_u |   2.476351   .0621338    39.86   0.000     2.354571    2.598131
             /sigma_e |   2.973085   .0192602   154.36   0.000     2.935336    3.010834
----------------------+----------------------------------------------------------------
                  rho |   .4095979   .0123884                      .3855053     .434037
---------------------------------------------------------------------------------------
        20,586  left-censored observations
        14,648     uncensored observations
             0 right-censored observations

. 
. * set the initial values
. matrix init = e(b)

. 
. * estimate the model on data up to 1998
. * don't include post2001 variable (obviously)
. eststo trainmod: xttobit lneconaidpc PUBRES lagXpub lagphysint lagalliance allXpub lagdonorallyneighbor2 neiXpub lags3un s3unXpub laglnreftotal laglnnytimes lagratperc
> ent lagdonor_physint lagpolity2 laglneconaidpc lnworldaidecon lagln_rgdpc lagln_population lagln_trade dyad_colony socialist ColdWar coldwarsoc lagwar region_SSA regio
> n_Latin region_MENA region_EAsiaPac if(inmysample==1 & year<=1998), ll(0) intpoints(19) from(init)


Fitting full model:

Iteration 0:   log likelihood = -33757.576  
Iteration 1:   log likelihood = -33658.996  
Iteration 2:   log likelihood = -33657.954  
Iteration 3:   log likelihood = -33657.952  

Random-effects tobit regression                 Number of obs     =     27,553
Group variable: dyadnum                         Number of groups  =      2,084

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          1
                                                              avg =       13.2
                                                              max =         17

Integration method: mvaghermite                 Integration pts.  =         19

                                                Wald chi2(28)     =    3266.88
Log likelihood  = -33657.952                    Prob > chi2       =     0.0000

---------------------------------------------------------------------------------------
          lneconaidpc |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
----------------------+----------------------------------------------------------------
               PUBRES |  -1.960698   .2980396    -6.58   0.000    -2.544845   -1.376552
              lagXpub |   .2641631   .0420948     6.28   0.000     .1816588    .3466674
           lagphysint |  -.0781484   .0198953    -3.93   0.000    -.1171425   -.0391543
          lagalliance |   .1586528   .2503367     0.63   0.526    -.3319981    .6493036
              allXpub |   .6649099   .7795786     0.85   0.394     -.863036    2.192856
lagdonorallyneighbor2 |  -.1564911   .2533637    -0.62   0.537    -.6530748    .3400927
              neiXpub |   1.035975   .3349213     3.09   0.002     .3795417    1.692409
              lags3un |   -.177489   .2264911    -0.78   0.433    -.6214033    .2664254
             s3unXpub |   1.790678   .5865302     3.05   0.002     .6410998    2.940256
        laglnreftotal |   .0374192   .0163433     2.29   0.022      .005387    .0694515
         laglnnytimes |  -.2004484   .0409029    -4.90   0.000    -.2806166   -.1202802
        lagratpercent |  -.5761084   .1933773    -2.98   0.003    -.9551209   -.1970959
     lagdonor_physint |   .0906703   .0431514     2.10   0.036     .0060952    .1752454
           lagpolity2 |    .028121   .0073552     3.82   0.000      .013705    .0425369
       laglneconaidpc |   .3346487   .0128335    26.08   0.000     .3094955     .359802
       lnworldaidecon |   1.189782   .0413873    28.75   0.000     1.108665      1.2709
          lagln_rgdpc |  -.5672912   .1066293    -5.32   0.000    -.7762807   -.3583017
     lagln_population |   .4854594   .0679259     7.15   0.000     .3523271    .6185917
          lagln_trade |   .0835407   .0128358     6.51   0.000      .058383    .1086984
          dyad_colony |   2.400527   .4410337     5.44   0.000     1.536117    3.264937
            socialist |  -.7844423   .2394486    -3.28   0.001    -1.253753   -.3151317
              ColdWar |  -.0713648   .0917034    -0.78   0.436    -.2511002    .1083705
           coldwarsoc |   1.170699   .1450855     8.07   0.000      .886337    1.455062
               lagwar |  -.0376176   .0952483    -0.39   0.693    -.2243008    .1490656
           region_SSA |   .9182822   .2998347     3.06   0.002      .330617    1.505947
         region_Latin |   .4367521   .3085485     1.42   0.157    -.1679919    1.041496
          region_MENA |  -1.549784   .3582051    -4.33   0.000    -2.251853    -.847715
      region_EAsiaPac |   .3642558    .316888     1.15   0.250    -.2568333     .985345
                _cons |   -26.0555   1.513425   -17.22   0.000    -29.02176   -23.08924
----------------------+----------------------------------------------------------------
             /sigma_u |   2.904588   .0781427    37.17   0.000     2.751431    3.057744
             /sigma_e |   3.194524    .024667   129.51   0.000     3.146177     3.24287
----------------------+----------------------------------------------------------------
                  rho |   .4525698   .0136978                      .4258512    .4795049
---------------------------------------------------------------------------------------
        16,945  left-censored observations
        10,608     uncensored observations
             0 right-censored observations

. 
. * create out of sample predictions for 1999 and 2000
. predict oospredict if(inmysample==1 &(year==1999 | year==2000)), ys(0, .)
(116,228 missing values generated)

. gen epsilon = oospredict - lneconaidpc
(116,228 missing values generated)

. *code source: http://www.stata.com/statalist/archive/2011-10/msg00827.html
. egen mean_epsilon = mean(epsilon), by(dyadnum)
(70228 missing values generated)

. * note: this is to correct for the fact that predictions margin out the random effects
. gen oospredict_a = oospredict - mean_epsilon
(116,228 missing values generated)

. 
. * how does it look?
. scatter oospredict_a lneconaidpc

. 
. 
. * compare to fit without the PUBRES interaction
. * use paper model to generate initial values
. xttobit lneconaidpc PUBRES lagphysint lagalliance allXpub lagdonorallyneighbor2 neiXpub lags3un s3unXpub laglnreftotal laglnnytimes lagratpercent lagdonor_physint lagp
> olity2 laglneconaidpc lnworldaidecon lagln_rgdpc lagln_population lagln_trade dyad_colony socialist ColdWar coldwarsoc lagwar region_SSA region_Latin region_MENA regio
> n_EAsiaPac if(inmysample==1), ll(0) intpoints(19)

Obtaining starting values for full model:

Iteration 0:   log likelihood = -73007.312
Iteration 1:   log likelihood = -71854.143
Iteration 2:   log likelihood = -71734.084
Iteration 3:   log likelihood = -71732.162
Iteration 4:   log likelihood =  -71732.16

Fitting full model:

Iteration 0:   log likelihood = -53523.902  
Iteration 1:   log likelihood = -47410.238  
Iteration 2:   log likelihood = -44852.168  
Iteration 3:   log likelihood = -44574.426  
Iteration 4:   log likelihood = -44512.415  
Iteration 5:   log likelihood = -44512.256  
Iteration 6:   log likelihood = -44512.256  

Random-effects tobit regression                 Number of obs     =     35,234
Group variable: dyadnum                         Number of groups  =      2,088

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          1
                                                              avg =       16.9
                                                              max =         21

Integration method: mvaghermite                 Integration pts.  =         19

                                                Wald chi2(27)     =    4536.07
Log likelihood  = -44512.256                    Prob > chi2       =     0.0000

---------------------------------------------------------------------------------------
          lneconaidpc |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
----------------------+----------------------------------------------------------------
               PUBRES |  -.9986349   .2089847    -4.78   0.000    -1.408237   -.5890325
           lagphysint |  -.0646576    .016167    -4.00   0.000    -.0963443    -.032971
          lagalliance |   .3546809   .2065998     1.72   0.086    -.0502472     .759609
              allXpub |   1.185383   .6151649     1.93   0.054    -.0203184    2.391084
lagdonorallyneighbor2 |  -.1245727   .2074533    -0.60   0.548    -.5311736    .2820283
              neiXpub |     .82084   .2651635     3.10   0.002     .3011292    1.340551
              lags3un |  -.1944983   .1781046    -1.09   0.275    -.5435769    .1545804
             s3unXpub |   1.160707   .4354548     2.67   0.008     .3072309    2.014182
        laglnreftotal |   .0455308   .0132598     3.43   0.001      .019542    .0715195
         laglnnytimes |  -.1004936   .0322124    -3.12   0.002    -.1636287   -.0373585
        lagratpercent |  -.2767626   .1523403    -1.82   0.069    -.5753442    .0218189
     lagdonor_physint |  -.0211164   .0337777    -0.63   0.532    -.0873196    .0450867
           lagpolity2 |    .032983   .0059558     5.54   0.000     .0213099     .044656
       laglneconaidpc |   .4009713   .0102412    39.15   0.000     .3808989    .4210438
       lnworldaidecon |   .9759882   .0336506    29.00   0.000     .9100342    1.041942
          lagln_rgdpc |  -.3368877   .0839493    -4.01   0.000    -.5014253   -.1723502
     lagln_population |   .4454749   .0559739     7.96   0.000      .335768    .5551817
          lagln_trade |    .078365   .0101992     7.68   0.000     .0583749    .0983551
          dyad_colony |   1.866564   .3719206     5.02   0.000     1.137613    2.595515
            socialist |  -.6012353   .2023682    -2.97   0.003    -.9978697    -.204601
              ColdWar |  -.0309004   .0797289    -0.39   0.698    -.1871663    .1253654
           coldwarsoc |   1.068737   .1190433     8.98   0.000     .8354163    1.302058
               lagwar |  -.0787731    .075936    -1.04   0.300     -.227605    .0700588
           region_SSA |   .8831571   .2448069     3.61   0.000     .4033444     1.36297
         region_Latin |   .1666826   .2517988     0.66   0.508     -.326834    .6601991
          region_MENA |   -1.60085   .2942307    -5.44   0.000    -2.177531   -1.024168
      region_EAsiaPac |   .1111052   .2616456     0.42   0.671    -.4017107    .6239212
                _cons |  -22.30426   1.223432   -18.23   0.000    -24.70214   -19.90638
----------------------+----------------------------------------------------------------
             /sigma_u |   2.481528   .0623226    39.82   0.000     2.359378    2.603678
             /sigma_e |   2.976385   .0192842   154.34   0.000     2.938589    3.014181
----------------------+----------------------------------------------------------------
                  rho |   .4100715    .012404                      .3859479    .4345405
---------------------------------------------------------------------------------------
        20,586  left-censored observations
        14,648     uncensored observations
             0 right-censored observations

. 
. * set the initial values
. matrix init = e(b)

. 
. * estimate the model
. eststo noint: xttobit lneconaidpc PUBRES lagphysint lagalliance allXpub lagdonorallyneighbor2 neiXpub lags3un s3unXpub laglnreftotal laglnnytimes lagratpercent lagdono
> r_physint lagpolity2 laglneconaidpc lnworldaidecon lagln_rgdpc lagln_population lagln_trade dyad_colony socialist ColdWar coldwarsoc lagwar region_SSA region_Latin reg
> ion_MENA region_EAsiaPac if(inmysample==1 & year<=1998), ll(0) intpoints(19) from(init)


Fitting full model:

Iteration 0:   log likelihood = -33778.522  
Iteration 1:   log likelihood = -33678.752  
Iteration 2:   log likelihood = -33677.701  
Iteration 3:   log likelihood = -33677.699  

Random-effects tobit regression                 Number of obs     =     27,553
Group variable: dyadnum                         Number of groups  =      2,084

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          1
                                                              avg =       13.2
                                                              max =         17

Integration method: mvaghermite                 Integration pts.  =         19

                                                Wald chi2(27)     =    3234.23
Log likelihood  = -33677.699                    Prob > chi2       =     0.0000

---------------------------------------------------------------------------------------
          lneconaidpc |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
----------------------+----------------------------------------------------------------
               PUBRES |  -1.300205   .2760163    -4.71   0.000    -1.841187   -.7592231
           lagphysint |  -.0754529   .0199125    -3.79   0.000    -.1144807   -.0364251
          lagalliance |   .1050443   .2505827     0.42   0.675    -.3860888    .5961773
              allXpub |   1.714778    .757263     2.26   0.024     .2305697    3.198986
lagdonorallyneighbor2 |  -.1978466   .2537483    -0.78   0.436    -.6951842     .299491
              neiXpub |    1.02413   .3343646     3.06   0.002     .3687874    1.679473
              lags3un |  -.1597739   .2268097    -0.70   0.481    -.6043128     .284765
             s3unXpub |   1.531224   .5796233     2.64   0.008     .3951829    2.667265
        laglnreftotal |   .0350152   .0163425     2.14   0.032     .0029844     .067046
         laglnnytimes |  -.2074336   .0409226    -5.07   0.000    -.2876404   -.1272269
        lagratpercent |  -.5735004   .1935522    -2.96   0.003    -.9528558    -.194145
     lagdonor_physint |   .0961846   .0431842     2.23   0.026     .0115452     .180824
           lagpolity2 |   .0287919   .0073584     3.91   0.000     .0143696    .0432142
       laglneconaidpc |   .3498674   .0126307    27.70   0.000     .3251118    .3746231
       lnworldaidecon |   1.189716   .0414319    28.71   0.000     1.108511    1.270921
          lagln_rgdpc |  -.5664831   .1067324    -5.31   0.000    -.7756747   -.3572914
     lagln_population |    .481866   .0680048     7.09   0.000      .348579     .615153
          lagln_trade |   .0850217   .0128406     6.62   0.000     .0598546    .1101888
          dyad_colony |   2.402123   .4415934     5.44   0.000     1.536616     3.26763
            socialist |  -.7570988   .2397243    -3.16   0.002     -1.22695   -.2872478
              ColdWar |  -.0595002   .0917638    -0.65   0.517    -.2393539    .1203534
           coldwarsoc |   1.139466   .1450767     7.85   0.000     .8551207    1.423811
               lagwar |  -.0683347    .095206    -0.72   0.473    -.2549352    .1182657
           region_SSA |   .8705573    .300127     2.90   0.004     .2823193    1.458795
         region_Latin |   .3959103   .3088559     1.28   0.200    -.2094361    1.001257
          region_MENA |  -1.570685   .3585375    -4.38   0.000    -2.273405   -.8679644
      region_EAsiaPac |    .343302   .3173075     1.08   0.279    -.2786093    .9652132
                _cons |  -26.10733   1.515221   -17.23   0.000    -29.07711   -23.13755
----------------------+----------------------------------------------------------------
             /sigma_u |   2.908965   .0783327    37.14   0.000     2.755435    3.062494
             /sigma_e |   3.198188   .0246987   129.49   0.000     3.149779    3.246597
----------------------+----------------------------------------------------------------
                  rho |   .4527478   .0137109                      .4260034    .4797085
---------------------------------------------------------------------------------------
        16,945  left-censored observations
        10,608     uncensored observations
             0 right-censored observations

. 
. *create out of sample predictions for 1999 and 2000
. predict oospredict2 if(inmysample==1 &(year==1999 | year==2000)), ys(0, .)
(116,228 missing values generated)

. gen epsilon2 = oospredict2 - lneconaidpc
(116,228 missing values generated)

. *code source: http://www.stata.com/statalist/archive/2011-10/msg00827.html
. egen mean_epsilon2 = mean(epsilon2), by(dyadnum)
(70228 missing values generated)

. * again, correct predictions for the margining out of random effects
. gen oospredict2_a = oospredict2 - mean_epsilon2
(116,228 missing values generated)

. 
. * which country-year observations changed the most between the models?
. gen change_abs = abs(oospredict - oospredict2)
(116,228 missing values generated)

. gen change = oospredict - oospredict2
(116,228 missing values generated)

. centile change_abs, c(98.5)

                                                       -- Binom. Interp. --
    Variable |       Obs  Percentile    Centile        [95% Conf. Interval]
-------------+-------------------------------------------------------------
  change_abs |     3,829       98.5    .3897903        .3355475    .4790561

. set more off

. sort change_abs

. list change_abs change countryname donorname year if change_abs >= (.3897903 ) & change_abs != .

        +----------------------------------------------------------------+
        | change~s      change       countryname        donorname   year |
        |----------------------------------------------------------------|
  3773. |  .391076     .391076              Peru          Denmark   1999 |
  3774. | .3923619   -.3923619             Sudan    United States   1999 |
  3775. | .3989105   -.3989105             Sudan   United Kingdom   2000 |
  3776. | .4023204    .4023204              Cuba           Canada   2000 |
  3777. | .4049511    .4049511       Afghanistan   United Kingdom   2000 |
        |----------------------------------------------------------------|
  3778. | .4067183   -.4067183   Myanmar (Burma)    United States   1999 |
  3779. | .4119406    .4119406           Burundi      Netherlands   2000 |
  3780. | .4133837   -.4133837   Myanmar (Burma)   United Kingdom   2000 |
  3781. | .4151545   -.4151545       Afghanistan    United States   2000 |
  3782. | .4175766    .4175766           Morocco    United States   2000 |
        |----------------------------------------------------------------|
  3783. | .4195173    .4195173             Sudan          Germany   2000 |
  3784. | .4511735    .4511735   Myanmar (Burma)           France   2000 |
  3785. | .4534757    .4534757           Burundi      Netherlands   1999 |
  3786. | .4768438    .4768438   Myanmar (Burma)           France   1999 |
  3787. | .4830439   -.4830439           Nigeria    United States   1999 |
        |----------------------------------------------------------------|
  3788. | .4886456    .4886456              Peru      Switzerland   1999 |
  3789. | .4966881    .4966881           Burundi      Switzerland   2000 |
  3790. | .4979138    .4979138   Myanmar (Burma)            Japan   2000 |
  3791. | .5232055    .5232055              Cuba            Italy   2000 |
  3792. | .5349834    .5349834           Burundi          Belgium   1999 |
        |----------------------------------------------------------------|
  3793. |  .538702     .538702            Rwanda   United Kingdom   2000 |
  3794. | .5595506    .5595506              Iraq           Norway   2000 |
  3795. |  .577317     .577317           Burundi   United Kingdom   2000 |
  3796. | .5835636    .5835636            Rwanda    United States   2000 |
  3797. |  .583842     .583842             Sudan           France   2000 |
        |----------------------------------------------------------------|
  3798. | .5923674    .5923674            Rwanda          Austria   2000 |
  3799. |  .596416     .596416           Burundi          Belgium   2000 |
  3800. | .6382668    .6382668           Morocco          Germany   2000 |
  3801. | .6440067    .6440067            Rwanda          Austria   1999 |
  3802. | .6540437    .6540437            Rwanda            Japan   1999 |
        |----------------------------------------------------------------|
  3803. | .7319403    .7319403             Sudan           France   1999 |
  3804. | .7349494    .7349494              Cuba          Germany   2000 |
  3805. | .7382417    .7382417            Rwanda      Netherlands   2000 |
  3806. | .7519686    .7519686              Peru   United Kingdom   1999 |
  3807. | .7614374    .7614374       Afghanistan          Germany   2000 |
        |----------------------------------------------------------------|
  3808. | .7664046    .7664046            Rwanda           Sweden   1999 |
  3809. | .7886865    .7886865            Rwanda    United States   1999 |
  3810. | .7952213    .7952213              Cuba   United Kingdom   2000 |
  3811. | .8058367    .8058367            Rwanda          Germany   2000 |
  3812. | .8577011    .8577011            Rwanda      Netherlands   1999 |
        |----------------------------------------------------------------|
  3813. | .8636072    .8636072           Morocco            Japan   2000 |
  3814. | .9255729    .9255729            Rwanda          Belgium   1999 |
  3815. | .9325306    .9325306           Morocco          Germany   1999 |
  3816. | .9463263    .9463263            Rwanda          Belgium   2000 |
  3817. | .9498124    .9498124            Rwanda           France   2000 |
        |----------------------------------------------------------------|
  3818. | .9826186    .9826186              Peru      Netherlands   1999 |
  3819. | .9975677    .9975677           Burundi           France   2000 |
  3820. | 1.012284    1.012284       Afghanistan   United Kingdom   1999 |
  3821. | 1.133528    1.133528              Peru            Japan   1999 |
  3822. | 1.154032    1.154032              Peru          Germany   1999 |
        |----------------------------------------------------------------|
  3823. | 1.210484    1.210484           Burundi           France   1999 |
  3824. | 1.215056    1.215056            Rwanda           France   1999 |
  3825. | 1.353828    1.353828   Myanmar (Burma)            Japan   1999 |
  3826. | 1.369328    1.369328           Morocco           France   2000 |
  3827. | 1.391304    1.391304           Morocco            Japan   1999 |
        |----------------------------------------------------------------|
  3828. |  1.39401     1.39401            Rwanda   United Kingdom   1999 |
  3829. | 1.494519    1.494519           Morocco           France   1999 |
        +----------------------------------------------------------------+

. 
. * how much did OOS forecasting error change?
. gen error_a = (oospredict_a - lneconaidpc)^2
(116,228 missing values generated)

. gen error2_a = (oospredict2_a - lneconaidpc)^2
(116,228 missing values generated)

. gen errorchange = error_a - error2_a
(116,228 missing values generated)

. ci means errorchange, level(90)

    Variable |        Obs        Mean    Std. Err.       [90% Conf. Interval]
-------------+---------------------------------------------------------------
 errorchange |      3,829   -.0025756    .0022526       -.0062817    .0011306

. ci means errorchange, level(50)

    Variable |        Obs        Mean    Std. Err.       [50% Conf. Interval]
-------------+---------------------------------------------------------------
 errorchange |      3,829   -.0025756    .0022526       -.0040951    -.001056

. 
. tsset dyadnum year
       panel variable:  dyadnum (unbalanced)
        time variable:  year, 1980 to 2006, but with gaps
                delta:  1 unit

. 
. * generate predictions for the original model on the full sample
. eststo esdem3: xttobit lneconaidpc PUBRES lagXpub l.physint l.alliance allXpub l.donorallyneighbor2 neiXpub l.s3un s3unXpub l.lnreftotal l.lnnytimes l.ratpercent l.don
> or_physint l.polity2 l.lneconaidpc lnworldaidecon l.ln_rgdpc l.ln_population l.ln_trade dyad_colony socialist ColdWar coldwarsoc l.war post2001 region_SSA region_Latin
>  region_MENA region_EAsiaPac if(inmysample==1), ll(0) intpoints(19)

Obtaining starting values for full model:

Iteration 0:   log likelihood = -72995.674
Iteration 1:   log likelihood = -71837.631
Iteration 2:   log likelihood = -71716.603
Iteration 3:   log likelihood = -71714.651
Iteration 4:   log likelihood = -71714.649

Fitting full model:

Iteration 0:   log likelihood = -53500.936  
Iteration 1:   log likelihood = -47383.982  
Iteration 2:   log likelihood = -44824.307  
Iteration 3:   log likelihood = -44545.768  
Iteration 4:   log likelihood = -44484.021  
Iteration 5:   log likelihood = -44483.865  
Iteration 6:   log likelihood = -44483.865  

Random-effects tobit regression                 Number of obs     =     35,234
Group variable: dyadnum                         Number of groups  =      2,088

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          1
                                                              avg =       16.9
                                                              max =         21

Integration method: mvaghermite                 Integration pts.  =         19

                                                Wald chi2(29)     =    4583.96
Log likelihood  = -44483.865                    Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
       lneconaidpc |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
            PUBRES |  -1.629113   .2271507    -7.17   0.000     -2.07432   -1.183906
           lagXpub |   .2489034   .0336479     7.40   0.000     .1829546    .3148522
                   |
           physint |
               L1. |  -.0644292   .0161606    -3.99   0.000    -.0961033   -.0327551
                   |
          alliance |
               L1. |   .3985323   .2063456     1.93   0.053    -.0058978    .8029623
                   |
           allXpub |   .2089894   .6331235     0.33   0.741     -1.03191    1.449889
                   |
donorallyneighbor2 |
               L1. |   -.088609   .2070586    -0.43   0.669    -.4944364    .3172183
                   |
           neiXpub |   .8258539   .2651878     3.11   0.002     .3060954    1.345612
                   |
              s3un |
               L1. |  -.1790268   .1797019    -1.00   0.319     -.531236    .1731824
                   |
          s3unXpub |   1.391859   .4392934     3.17   0.002     .5308596    2.252858
                   |
        lnreftotal |
               L1. |   .0445533   .0133715     3.33   0.001     .0183456    .0707609
                   |
         lnnytimes |
               L1. |  -.0982936   .0321863    -3.05   0.002    -.1613776   -.0352096
                   |
        ratpercent |
               L1. |  -.2997179   .1528433    -1.96   0.050    -.5992853   -.0001505
                   |
     donor_physint |
               L1. |  -.0221594   .0337711    -0.66   0.512    -.0883495    .0440307
                   |
           polity2 |
               L1. |   .0319693   .0059642     5.36   0.000     .0202796    .0436589
                   |
       lneconaidpc |
               L1. |   .3852768   .0104312    36.93   0.000     .3648319    .4057216
                   |
    lnworldaidecon |   .9790695   .0336349    29.11   0.000     .9131463    1.044993
                   |
          ln_rgdpc |
               L1. |  -.3439535   .0841434    -4.09   0.000    -.5088715   -.1790356
                   |
     ln_population |
               L1. |   .4479054   .0559139     8.01   0.000     .3383162    .5574947
                   |
          ln_trade |
               L1. |   .0771006   .0101944     7.56   0.000     .0571199    .0970813
                   |
       dyad_colony |   1.867914   .3713109     5.03   0.000     1.140158     2.59567
         socialist |  -.6229936    .202019    -3.08   0.002    -1.018943   -.2270437
           ColdWar |  -.0405848   .0796741    -0.51   0.610    -.1967431    .1155735
        coldwarsoc |   1.091554    .118998     9.17   0.000     .8583225    1.324786
                   |
               war |
               L1. |  -.0639571   .0759057    -0.84   0.399    -.2127295    .0848153
                   |
          post2001 |    .120315   .0921804     1.31   0.192    -.0603552    .3009852
        region_SSA |    .915184   .2444667     3.74   0.000     .4360381     1.39433
      region_Latin |    .208284   .2514655     0.83   0.408    -.2845793    .7011474
       region_MENA |  -1.568152   .2938213    -5.34   0.000    -2.144032    -.992273
   region_EAsiaPac |   .1412347   .2612104     0.54   0.589    -.3707283    .6531978
             _cons |  -22.28018   1.222166   -18.23   0.000    -24.67558   -19.88478
-------------------+----------------------------------------------------------------
          /sigma_u |   2.476214   .0621114    39.87   0.000     2.354478     2.59795
          /sigma_e |   2.973099   .0192603   154.36   0.000     2.935349    3.010848
-------------------+----------------------------------------------------------------
               rho |   .4095689   .0123842                      .3854844    .4339997
------------------------------------------------------------------------------------
        20,586  left-censored observations
        14,648     uncensored observations
             0 right-censored observations

. 
. predict esdempred, ys(0, .)
(84,686 missing values generated)

. gen esdem_epsilon = esdempred - lneconaidpc
(84,686 missing values generated)

. *code source: http://www.stata.com/statalist/archive/2011-10/msg00827.html
. egen mean_esdem_epsilon = mean(esdem_epsilon), by(dyadnum)
(65928 missing values generated)

. * correct for margining out of random effects
. gen esdempred_a = esdempred - mean_esdem_epsilon 
(84,686 missing values generated)

. 
. * generate predictions for the no lag interaction model on the full sample
. eststo nolag: xttobit lneconaidpc PUBRES l.physint l.alliance allXpub l.donorallyneighbor2 neiXpub l.s3un s3unXpub l.lnreftotal l.lnnytimes l.ratpercent l.donor_physin
> t l.polity2 l.lneconaidpc lnworldaidecon l.ln_rgdpc l.ln_population l.ln_trade dyad_colony socialist ColdWar coldwarsoc l.war post2001 region_SSA region_Latin region_M
> ENA region_EAsiaPac if(inmysample==1), ll(0) intpoints(19)

Obtaining starting values for full model:

Iteration 0:   log likelihood =  -73004.91
Iteration 1:   log likelihood = -71852.173
Iteration 2:   log likelihood = -71733.041
Iteration 3:   log likelihood = -71731.147
Iteration 4:   log likelihood = -71731.145

Fitting full model:

Iteration 0:   log likelihood = -53526.375  
Iteration 1:   log likelihood = -47414.431  
Iteration 2:   log likelihood = -44851.333  
Iteration 3:   log likelihood = -44573.189  
Iteration 4:   log likelihood = -44511.475  
Iteration 5:   log likelihood = -44511.317  
Iteration 6:   log likelihood = -44511.317  

Random-effects tobit regression                 Number of obs     =     35,234
Group variable: dyadnum                         Number of groups  =      2,088

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          1
                                                              avg =       16.9
                                                              max =         21

Integration method: mvaghermite                 Integration pts.  =         19

                                                Wald chi2(28)     =    4536.21
Log likelihood  = -44511.317                    Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
       lneconaidpc |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
            PUBRES |  -.9970524   .2090064    -4.77   0.000    -1.406697   -.5874075
                   |
           physint |
               L1. |  -.0638761   .0161773    -3.95   0.000    -.0955831   -.0321691
                   |
          alliance |
               L1. |   .3533077   .2065977     1.71   0.087    -.0516163    .7582318
                   |
           allXpub |   1.181425   .6151903     1.92   0.055    -.0243254    2.387176
                   |
donorallyneighbor2 |
               L1. |  -.1196904   .2074731    -0.58   0.564    -.5263302    .2869494
                   |
           neiXpub |   .8225332   .2651692     3.10   0.002     .3028112    1.342255
                   |
              s3un |
               L1. |  -.1588992   .1799729    -0.88   0.377    -.5116395    .1938412
                   |
          s3unXpub |   1.158248   .4355042     2.66   0.008     .3046756    2.011821
                   |
        lnreftotal |
               L1. |   .0431342   .0133741     3.23   0.001     .0169216    .0693469
                   |
         lnnytimes |
               L1. |  -.1004267   .0322123    -3.12   0.002    -.1635617   -.0372917
                   |
        ratpercent |
               L1. |  -.2964993   .1530266    -1.94   0.053     -.596426    .0034273
                   |
     donor_physint |
               L1. |  -.0195498   .0338008    -0.58   0.563     -.085798    .0466985
                   |
           polity2 |
               L1. |   .0324752   .0059673     5.44   0.000     .0207796    .0441709
                   |
       lneconaidpc |
               L1. |   .4006907   .0102434    39.12   0.000     .3806141    .4207674
                   |
    lnworldaidecon |   .9777137   .0336745    29.03   0.000     .9117128    1.043715
                   |
          ln_rgdpc |
               L1. |  -.3466634   .0842277    -4.12   0.000    -.5117468   -.1815801
                   |
     ln_population |
               L1. |   .4425288   .0559944     7.90   0.000     .3327818    .5522759
                   |
          ln_trade |
               L1. |   .0782922   .0101996     7.68   0.000     .0583013     .098283
                   |
       dyad_colony |   1.875727   .3719617     5.04   0.000     1.146695    2.604758
         socialist |  -.6035783   .2023663    -2.98   0.003    -1.000209   -.2069477
           ColdWar |  -.0298653    .079737    -0.37   0.708     -.186147    .1264163
        coldwarsoc |   1.067224   .1190509     8.96   0.000     .8338881    1.300559
                   |
               war |
               L1. |  -.0791455   .0759346    -1.04   0.297    -.2279745    .0696836
                   |
          post2001 |   .1264784   .0922604     1.37   0.170    -.0543487    .3073054
        region_SSA |   .8756419   .2448336     3.58   0.000     .3957769    1.355507
      region_Latin |   .1761954   .2518746     0.70   0.484    -.3174697    .6698605
       region_MENA |  -1.592296   .2942731    -5.41   0.000    -2.169061   -1.015531
   region_EAsiaPac |   .1191514   .2616916     0.46   0.649    -.3937547    .6320575
             _cons |   -22.2485   1.223627   -18.18   0.000    -24.64676   -19.85024
-------------------+----------------------------------------------------------------
          /sigma_u |   2.481343   .0622983    39.83   0.000     2.359241    2.603446
          /sigma_e |   2.976396   .0192843   154.34   0.000     2.938599    3.014192
-------------------+----------------------------------------------------------------
               rho |   .4100337   .0123996                      .3859185     .434494
------------------------------------------------------------------------------------
        20,586  left-censored observations
        14,648     uncensored observations
             0 right-censored observations

. 
. predict nolagpred, ys(0, .)
(84,686 missing values generated)

. gen nolag_epsilon = nolagpred - lneconaidpc
(84,686 missing values generated)

. *code source: http://www.stata.com/statalist/archive/2011-10/msg00827.html
. egen mean_nolag_epsilon = mean(nolag_epsilon), by(dyadnum)
(65928 missing values generated)

. * correct for margining out of random effects
. gen nolagpred_a = nolagpred - mean_nolag_epsilon 
(84,686 missing values generated)

. 
. 
. * create some plots comparing the (in-sample) predictions of the models with and without the PUBRES interaction
. sort dyadnum year

. 
. line esdempred_a nolagpred_a lneconaidpc year if(countryname == "Rwanda" & donorname == "United Kingdom" & year >=1982 & year <= 2002), legend(label(1 "Prediction with
>  Lag DV X UNCHR (Model 3)") label(2 "Prediction w/o Lag DV X UNCHR (Model 2)") label(3 "observed DV") size(vsmall)) scheme(s2mono) ytitle("ln (economic aid per capita 
> + 1)")

. 
. graph export rwanda-uk.eps, replace
(file rwanda-uk.eps written in EPS format)

. 
. line esdempred_a nolagpred_a lneconaidpc year if(countryname == "Morocco" & donorname == "France" & year >=1982 & year <= 2002), legend(label(1 "Prediction with Lag DV
>  X UNCHR (Model 3)") label(2 "Prediction w/o Lag DV X UNCHR (Model 2)") label(3 "observed DV") size(vsmall)) scheme(s2mono) ytitle("ln (economic aid per capita + 1)")

. 
. graph export morocco-france.eps, replace
(file morocco-france.eps written in EPS format)

. 
. line esdempred_a nolagpred_a lneconaidpc year if(countryname == "Peru" & donorname == "Germany" & year >=1982 & year <= 2002), legend(label(1 "Prediction with Lag DV X
>  UNCHR (Model 3)") label(2 "Prediction w/o Lag DV X UNCHR (Model 2)") label(3 "observed DV") size(vsmall)) scheme(s2mono) ytitle("ln (economic aid per capita + 1)")

. 
. graph export peru-germany.eps, replace
(file peru-germany.eps written in EPS format)

. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. *****************************************************
. * Neilsen data
. * dyadic aid flow analysis
. * Lebovic/Voeten UNCHR condemnation variable
. * 
. * auxiliary analysis: more lags
. *****************************************************
. 
. * create common sample for old and new models
. 
. clear all

. set mem 1000M
set memory ignored.
    Memory no longer needs to be set in modern Statas; memory adjustments are performed on the fly automatically.

. set more off

. set matsize 800

. 
. 
. ** merge in public resolution data
. use jprworkdatanew.dta, clear

. rename YEAR year 

. rename CCODE countrynumcode_g

. save jpr_merge.dta, replace
file jpr_merge.dta saved

. 
. use "dat2.dta", clear

. 
. merge m:1 year countrynumcode_g year using jpr_merge.dta

    Result                           # of obs.
    -----------------------------------------
    not matched                        51,079
        from master                    50,316  (_merge==1)
        from using                        763  (_merge==2)

    matched                            69,741  (_merge==3)
    -----------------------------------------

. drop if _merge==2
(763 observations deleted)

. 
. tsset dyadnum year
       panel variable:  dyadnum (unbalanced)
        time variable:  year, 1980 to 2006, but with gaps
                delta:  1 unit

. 
. gen allXpub = PUBRES*l.alliance
(66,759 missing values generated)

. gen neiXpub = PUBRES*l.donorallyneighbor2
(66,633 missing values generated)

. gen s3unXpub = PUBRES*l.s3un
(66,693 missing values generated)

. 
. gen lagXpub = PUBRES*l.lneconaidpc
(66,864 missing values generated)

. gen lag2Xpub = PUBRES*L2.lneconaidpc
(69,174 missing values generated)

. 
. gen laglneconaidpc = l.lneconaidpc 
(35,910 missing values generated)

. gen lag2lneconaidpc = L2.lneconaidpc 
(35,973 missing values generated)

. 
. * the esarey-demeritt model with more lags
. eststo morelags: xttobit lneconaidpc PUBRES lagXpub lag2Xpub laglneconaidpc lag2lneconaidpc l.physint l.alliance allXpub l.donorallyneighbor2 neiXpub l.s3un s3unXpub l
> .lnreftotal l.lnnytimes l.ratpercent l.donor_physint l.polity2 lnworldaidecon l.ln_rgdpc l.ln_population l.ln_trade dyad_colony socialist ColdWar coldwarsoc l.war post
> 2001 region_SSA region_Latin region_MENA region_EAsiaPac if(inmysample==1), ll(0) intpoints(19)

Obtaining starting values for full model:

Iteration 0:   log likelihood = -71111.555
Iteration 1:   log likelihood = -71088.903
Iteration 2:   log likelihood =  -71088.89

Fitting full model:

Iteration 0:   log likelihood = -58497.639  (not concave)
Iteration 1:   log likelihood = -49513.645  (not concave)
Iteration 2:   log likelihood = -48563.495  
Iteration 3:   log likelihood =  -47965.34  
Iteration 4:   log likelihood = -44618.029  
Iteration 5:   log likelihood = -44184.143  
Iteration 6:   log likelihood = -44149.116  
Iteration 7:   log likelihood = -44148.496  
Iteration 8:   log likelihood = -44148.495  

Random-effects tobit regression                 Number of obs     =     35,234
Group variable: dyadnum                         Number of groups  =      2,088

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          1
                                                              avg =       16.9
                                                              max =         21

Integration method: mvaghermite                 Integration pts.  =         19

                                                Wald chi2(31)     =    5722.67
Log likelihood  = -44148.495                    Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
       lneconaidpc |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
            PUBRES |  -1.243228    .224401    -5.54   0.000    -1.683046     -.80341
           lagXpub |   .2193507   .0400209     5.48   0.000     .1409111    .2977903
          lag2Xpub |   .0084607   .0399318     0.21   0.832    -.0698042    .0867256
    laglneconaidpc |   .3427832   .0105853    32.38   0.000     .3220363    .3635301
   lag2lneconaidpc |    .258547   .0102832    25.14   0.000     .2383922    .2787018
                   |
           physint |
               L1. |  -.0591572   .0158641    -3.73   0.000    -.0902504   -.0280641
                   |
          alliance |
               L1. |   .3113236    .186293     1.67   0.095    -.0538039    .6764511
                   |
           allXpub |   .0581963   .6204603     0.09   0.925    -1.157884    1.274276
                   |
donorallyneighbor2 |
               L1. |  -.0569776     .18015    -0.32   0.752    -.4100652    .2961099
                   |
           neiXpub |   .4997287   .2516595     1.99   0.047     .0064852    .9929722
                   |
              s3un |
               L1. |  -.1280516   .1688191    -0.76   0.448    -.4589309    .2028276
                   |
          s3unXpub |   1.270719   .4279502     2.97   0.003     .4319516    2.109486
                   |
        lnreftotal |
               L1. |   .0384338   .0129209     2.97   0.003     .0131094    .0637582
                   |
         lnnytimes |
               L1. |  -.0663974   .0314963    -2.11   0.035    -.1281291   -.0046658
                   |
        ratpercent |
               L1. |  -.0513342   .1414942    -0.36   0.717    -.3286578    .2259893
                   |
     donor_physint |
               L1. |  -.0261388   .0332165    -0.79   0.431     -.091242    .0389644
                   |
           polity2 |
               L1. |   .0310754    .005747     5.41   0.000     .0198115    .0423393
                   |
    lnworldaidecon |   .8485723   .0319233    26.58   0.000     .7860038    .9111409
                   |
          ln_rgdpc |
               L1. |  -.3412941   .0749261    -4.56   0.000    -.4881466   -.1944416
                   |
     ln_population |
               L1. |   .3595037   .0476867     7.54   0.000     .2660395    .4529679
                   |
          ln_trade |
               L1. |   .0678723   .0098062     6.92   0.000     .0486526    .0870921
                   |
       dyad_colony |    1.30919   .3074485     4.26   0.000     .7066018    1.911778
         socialist |   -.410421   .1743732    -2.35   0.019    -.7521863   -.0686558
           ColdWar |  -.0938466   .0776142    -1.21   0.227    -.2459677    .0582745
        coldwarsoc |   .8633632   .1176971     7.34   0.000     .6326813    1.094045
                   |
               war |
               L1. |  -.0226191   .0739644    -0.31   0.760    -.1675867    .1223484
                   |
          post2001 |   .0866724   .0910148     0.95   0.341    -.0917134    .2650582
        region_SSA |   .5806505   .2066185     2.81   0.005     .1756857    .9856152
      region_Latin |   .0340721   .2107742     0.16   0.872    -.3790378    .4471819
       region_MENA |   -1.41553   .2490854    -5.68   0.000    -1.903729   -.9273322
   region_EAsiaPac |   .0273137   .2183221     0.13   0.900    -.4005897    .4552172
             _cons |  -19.18744   1.110737   -17.27   0.000    -21.36445   -17.01044
-------------------+----------------------------------------------------------------
          /sigma_u |   1.989945   .0581109    34.24   0.000      1.87605     2.10384
          /sigma_e |   2.951571   .0191723   153.95   0.000     2.913994    2.989148
-------------------+----------------------------------------------------------------
               rho |   .3124992   .0128585                       .287751    .3381232
------------------------------------------------------------------------------------
        20,586  left-censored observations
        14,648     uncensored observations
             0 right-censored observations

. 
. gen lagsample = e(sample)

. 
. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
    morelags |     35,234         .   -44148.5      34    88364.99   88652.96
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. mat icsto = r(S)

. scalar aicsto = icsto[1,5]

. scalar bicsto = icsto[1,6]

. estadd scalar AIC = aicsto: morelags

. estadd scalar BIC = bicsto: morelags

. 
. scalar drop aicsto bicsto

. mat drop icsto

. 
. unique countryname if e(sample)
Number of unique values of countryname is  100
Number of records is  35234

. estadd scalar countries = r(sum): morelags

. 
. unique donorname if e(sample)
Number of unique values of donorname is  21
Number of records is  35234

. estadd scalar donors = r(sum): morelags

. 
. unique dyadnum if e(sample)
Number of unique values of dyadnum is  2088
Number of records is  35234

. estadd scalar dyads= r(sum): morelags

. 
. tab year if e(sample)

       year |      Freq.     Percent        Cum.
------------+-----------------------------------
       1982 |      1,539        4.37        4.37
       1983 |      1,558        4.42        8.79
       1984 |      1,558        4.42       13.21
       1985 |      1,596        4.53       17.74
       1986 |      1,558        4.42       22.16
       1987 |      1,558        4.42       26.59
       1988 |      1,501        4.26       30.85
       1989 |      1,539        4.37       35.21
       1990 |      1,558        4.42       39.64
       1991 |      1,557        4.42       44.05
       1992 |      1,575        4.47       48.52
       1993 |      1,556        4.42       52.94
       1994 |      1,727        4.90       57.84
       1995 |      1,738        4.93       62.77
       1996 |      1,705        4.84       67.61
       1997 |      1,782        5.06       72.67
       1998 |      1,948        5.53       78.20
       1999 |      1,906        5.41       83.61
       2000 |      1,923        5.46       89.07
       2001 |      1,928        5.47       94.54
       2002 |      1,924        5.46      100.00
------------+-----------------------------------
      Total |     35,234      100.00

. 
. * the esarey-demeritt model
. eststo fewlags: xttobit lneconaidpc PUBRES lagXpub laglneconaidpc l.physint l.alliance allXpub l.donorallyneighbor2 neiXpub l.s3un s3unXpub l.lnreftotal l.lnnytimes l.
> ratpercent l.donor_physint l.polity2 lnworldaidecon l.ln_rgdpc l.ln_population l.ln_trade dyad_colony socialist ColdWar coldwarsoc l.war post2001 region_SSA region_Lat
> in region_MENA region_EAsiaPac if(lagsample==1), ll(0) intpoints(19)

Obtaining starting values for full model:

Iteration 0:   log likelihood = -72995.674
Iteration 1:   log likelihood = -71837.631
Iteration 2:   log likelihood = -71716.603
Iteration 3:   log likelihood = -71714.651
Iteration 4:   log likelihood = -71714.649

Fitting full model:

Iteration 0:   log likelihood = -53500.936  
Iteration 1:   log likelihood = -47383.982  
Iteration 2:   log likelihood = -44824.307  
Iteration 3:   log likelihood = -44545.768  
Iteration 4:   log likelihood = -44484.021  
Iteration 5:   log likelihood = -44483.865  
Iteration 6:   log likelihood = -44483.865  

Random-effects tobit regression                 Number of obs     =     35,234
Group variable: dyadnum                         Number of groups  =      2,088

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          1
                                                              avg =       16.9
                                                              max =         21

Integration method: mvaghermite                 Integration pts.  =         19

                                                Wald chi2(29)     =    4583.96
Log likelihood  = -44483.865                    Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
       lneconaidpc |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
            PUBRES |  -1.629113   .2271507    -7.17   0.000     -2.07432   -1.183906
           lagXpub |   .2489034   .0336479     7.40   0.000     .1829546    .3148522
    laglneconaidpc |   .3852768   .0104312    36.93   0.000     .3648319    .4057216
                   |
           physint |
               L1. |  -.0644292   .0161606    -3.99   0.000    -.0961033   -.0327551
                   |
          alliance |
               L1. |   .3985323   .2063456     1.93   0.053    -.0058978    .8029623
                   |
           allXpub |   .2089894   .6331235     0.33   0.741     -1.03191    1.449889
                   |
donorallyneighbor2 |
               L1. |   -.088609   .2070586    -0.43   0.669    -.4944364    .3172183
                   |
           neiXpub |   .8258539   .2651878     3.11   0.002     .3060954    1.345612
                   |
              s3un |
               L1. |  -.1790268   .1797019    -1.00   0.319     -.531236    .1731824
                   |
          s3unXpub |   1.391859   .4392934     3.17   0.002     .5308596    2.252858
                   |
        lnreftotal |
               L1. |   .0445533   .0133715     3.33   0.001     .0183456    .0707609
                   |
         lnnytimes |
               L1. |  -.0982936   .0321863    -3.05   0.002    -.1613776   -.0352096
                   |
        ratpercent |
               L1. |  -.2997179   .1528433    -1.96   0.050    -.5992853   -.0001505
                   |
     donor_physint |
               L1. |  -.0221594   .0337711    -0.66   0.512    -.0883495    .0440307
                   |
           polity2 |
               L1. |   .0319693   .0059642     5.36   0.000     .0202796    .0436589
                   |
    lnworldaidecon |   .9790695   .0336349    29.11   0.000     .9131463    1.044993
                   |
          ln_rgdpc |
               L1. |  -.3439535   .0841434    -4.09   0.000    -.5088715   -.1790356
                   |
     ln_population |
               L1. |   .4479054   .0559139     8.01   0.000     .3383162    .5574947
                   |
          ln_trade |
               L1. |   .0771006   .0101944     7.56   0.000     .0571199    .0970813
                   |
       dyad_colony |   1.867914   .3713109     5.03   0.000     1.140158     2.59567
         socialist |  -.6229936    .202019    -3.08   0.002    -1.018943   -.2270437
           ColdWar |  -.0405848   .0796741    -0.51   0.610    -.1967431    .1155735
        coldwarsoc |   1.091554    .118998     9.17   0.000     .8583225    1.324786
                   |
               war |
               L1. |  -.0639571   .0759057    -0.84   0.399    -.2127295    .0848153
                   |
          post2001 |    .120315   .0921804     1.31   0.192    -.0603552    .3009852
        region_SSA |    .915184   .2444667     3.74   0.000     .4360381     1.39433
      region_Latin |    .208284   .2514655     0.83   0.408    -.2845793    .7011474
       region_MENA |  -1.568152   .2938213    -5.34   0.000    -2.144032    -.992273
   region_EAsiaPac |   .1412347   .2612104     0.54   0.589    -.3707283    .6531978
             _cons |  -22.28018   1.222166   -18.23   0.000    -24.67558   -19.88478
-------------------+----------------------------------------------------------------
          /sigma_u |   2.476214   .0621114    39.87   0.000     2.354478     2.59795
          /sigma_e |   2.973099   .0192603   154.36   0.000     2.935349    3.010848
-------------------+----------------------------------------------------------------
               rho |   .4095689   .0123842                      .3854844    .4339997
------------------------------------------------------------------------------------
        20,586  left-censored observations
        14,648     uncensored observations
             0 right-censored observations

. 
. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
     fewlags |     35,234         .  -44483.86      32    89031.73   89302.76
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. mat icsto = r(S)

. scalar aicsto = icsto[1,5]

. scalar bicsto = icsto[1,6]

. estadd scalar AIC = aicsto: fewlags

. estadd scalar BIC = bicsto: fewlags

. 
. scalar drop aicsto bicsto

. mat drop icsto

. 
. unique countryname if e(sample)
Number of unique values of countryname is  100
Number of records is  35234

. estadd scalar countries = r(sum): fewlags

. 
. unique donorname if e(sample)
Number of unique values of donorname is  21
Number of records is  35234

. estadd scalar donors = r(sum): fewlags

. 
. unique dyadnum if e(sample)
Number of unique values of dyadnum is  2088
Number of records is  35234

. estadd scalar dyads= r(sum): fewlags

. 
. tab year if e(sample)

       year |      Freq.     Percent        Cum.
------------+-----------------------------------
       1982 |      1,539        4.37        4.37
       1983 |      1,558        4.42        8.79
       1984 |      1,558        4.42       13.21
       1985 |      1,596        4.53       17.74
       1986 |      1,558        4.42       22.16
       1987 |      1,558        4.42       26.59
       1988 |      1,501        4.26       30.85
       1989 |      1,539        4.37       35.21
       1990 |      1,558        4.42       39.64
       1991 |      1,557        4.42       44.05
       1992 |      1,575        4.47       48.52
       1993 |      1,556        4.42       52.94
       1994 |      1,727        4.90       57.84
       1995 |      1,738        4.93       62.77
       1996 |      1,705        4.84       67.61
       1997 |      1,782        5.06       72.67
       1998 |      1,948        5.53       78.20
       1999 |      1,906        5.41       83.61
       2000 |      1,923        5.46       89.07
       2001 |      1,928        5.47       94.54
       2002 |      1,924        5.46      100.00
------------+-----------------------------------
      Total |     35,234      100.00

. 
. 
. 
. esttab fewlags morelags using "lagcheck.tex", title("Dyadic Bilateral Aid Flows, Alternate Lags*\label{tab:lagcheck-1}") longtable replace keep(laglneconaidpc lag2lnec
> onaidpc L.physint PUBRES lagXpub lag2Xpub L.alliance allXpub L.donorallyneighbor2 neiXpub L.s3un s3unXpub) order(PUBRES laglneconaidpc lag2lneconaidpc lagXpub lag2Xpub
>  L.physint L.alliance allXpub L.donorallyneighbor2 neiXpub L.s3un s3unXpub) eqlabels(,none) nomtitles nodepvars coeflabels(laglneconaidpc  "DV\$_{i(t-1)}$" lag2lnecona
> idpc  "DV\$_{i(t-2)}$" L.physint  "Physical Integrity Violations\$_{i(t-1)}$" PUBRES "UNCHR Resolution\$_{i(t-1)}$" lagXpub "DV\$_{i(t-1)}$ * Resolution\$_{i(t-1)}$" l
> ag2Xpub "DV\$_{i(t-2)}$ * Resolution\$_{i(t-1)}$" L.alliance "Alliance\$_{i(t-1)}$" allXpub "Alliance\$_{i(t-1)}$ * Resolution\$_{i(t-1)}$" L.donorallyneighbor2 "Ally 
> Neighbor\$_{i(t-1)}$" neiXpub "Ally Neighbor\$_{i(t-1)}$ * Resolution\$_{i(t-1)}$" L.s3un "UN Voting Similarity\$_{i(t-1)}$" s3unXpub "UN Similarity\$_{i(t-1)}$ * Reso
> lution\$_{i(t-1)}$") noabbrev wrap gaps varwidth(48) align(r) substitute(\_ _) stats(N dyads countries donors blank AIC BIC, labels("Observations" "Dyads" "Recipients"
>  "Donors" " " "AIC" "BIC"))
(output written to lagcheck.tex)

. 
. 
. 
. 
. 
. 
. 
. 
. * alternative approach to initial condition problem
. * per Wooldridge 2005
. 
. 
. clear all

. set mem 1000M
set memory ignored.
    Memory no longer needs to be set in modern Statas; memory adjustments are performed on the fly automatically.

. set more off

. set matsize 800

. 
. 
. ** merge in public resolution data
. use jprworkdatanew.dta, clear

. rename YEAR year 

. rename CCODE countrynumcode_g

. save jpr_merge.dta, replace
file jpr_merge.dta saved

. 
. use "dat2.dta", clear

. 
. merge m:1 year countrynumcode_g year using jpr_merge.dta

    Result                           # of obs.
    -----------------------------------------
    not matched                        51,079
        from master                    50,316  (_merge==1)
        from using                        763  (_merge==2)

    matched                            69,741  (_merge==3)
    -----------------------------------------

. drop if _merge==2
(763 observations deleted)

. 
. tsset dyadnum year
       panel variable:  dyadnum (unbalanced)
        time variable:  year, 1980 to 2006, but with gaps
                delta:  1 unit

. 
. gen allXpub = PUBRES*l.alliance
(66,759 missing values generated)

. gen neiXpub = PUBRES*l.donorallyneighbor2
(66,633 missing values generated)

. gen s3unXpub = PUBRES*l.s3un
(66,693 missing values generated)

. 
. gen lagXpub = PUBRES*l.lneconaidpc
(66,864 missing values generated)

. 
. 
. * generate lag variables to enable setting initial values
. * for the xttobit model
. gen lagphysint = l.physint 
(41,727 missing values generated)

. gen lagalliance = l.alliance 
(37,968 missing values generated)

. gen lagdonorallyneighbor2 = l.donorallyneighbor2 
(11,109 missing values generated)

. gen lags3un = l.s3un 
(25,446 missing values generated)

. gen laglnreftotal = l.lnreftotal 
(22,113 missing values generated)

. gen laglnnytimes = l.lnnytimes 
(60,249 missing values generated)

. gen lagratpercent = l.ratpercent 
(6,552 missing values generated)

. gen lagdonor_physint = l.donor_physint 
(10,437 missing values generated)

. gen lagpolity2 = l.polity2 
(38,766 missing values generated)

. gen laglneconaidpc = l.lneconaidpc 
(35,910 missing values generated)

. gen lagln_rgdpc = l.ln_rgdpc 
(35,910 missing values generated)

. gen lagln_population = l.ln_population 
(35,910 missing values generated)

. gen lagln_trade = l.ln_trade 
(40,084 missing values generated)

. gen lagwar = l.war
(29,862 missing values generated)

. 
. * repeat paper model 
. eststo noinit: xttobit lneconaidpc PUBRES lagXpub lagphysint lagalliance allXpub lagdonorallyneighbor2 neiXpub lags3un s3unXpub laglnreftotal laglnnytimes lagratpercen
> t lagdonor_physint lagpolity2 laglneconaidpc lnworldaidecon lagln_rgdpc lagln_population lagln_trade dyad_colony socialist ColdWar coldwarsoc lagwar post2001 region_SS
> A region_Latin region_MENA region_EAsiaPac if(inmysample==1), ll(0) intpoints(19)

Obtaining starting values for full model:

Iteration 0:   log likelihood = -72995.674
Iteration 1:   log likelihood = -71837.631
Iteration 2:   log likelihood = -71716.603
Iteration 3:   log likelihood = -71714.651
Iteration 4:   log likelihood = -71714.649

Fitting full model:

Iteration 0:   log likelihood = -53500.936  
Iteration 1:   log likelihood = -47383.982  
Iteration 2:   log likelihood = -44824.307  
Iteration 3:   log likelihood = -44545.768  
Iteration 4:   log likelihood = -44484.021  
Iteration 5:   log likelihood = -44483.865  
Iteration 6:   log likelihood = -44483.865  

Random-effects tobit regression                 Number of obs     =     35,234
Group variable: dyadnum                         Number of groups  =      2,088

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          1
                                                              avg =       16.9
                                                              max =         21

Integration method: mvaghermite                 Integration pts.  =         19

                                                Wald chi2(29)     =    4583.96
Log likelihood  = -44483.865                    Prob > chi2       =     0.0000

---------------------------------------------------------------------------------------
          lneconaidpc |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
----------------------+----------------------------------------------------------------
               PUBRES |  -1.629113   .2271507    -7.17   0.000     -2.07432   -1.183906
              lagXpub |   .2489034   .0336479     7.40   0.000     .1829546    .3148522
           lagphysint |  -.0644292   .0161606    -3.99   0.000    -.0961033   -.0327551
          lagalliance |   .3985323   .2063456     1.93   0.053    -.0058978    .8029623
              allXpub |   .2089894   .6331235     0.33   0.741     -1.03191    1.449889
lagdonorallyneighbor2 |   -.088609   .2070586    -0.43   0.669    -.4944364    .3172183
              neiXpub |   .8258539   .2651878     3.11   0.002     .3060954    1.345612
              lags3un |  -.1790268   .1797019    -1.00   0.319     -.531236    .1731824
             s3unXpub |   1.391859   .4392934     3.17   0.002     .5308596    2.252858
        laglnreftotal |   .0445533   .0133715     3.33   0.001     .0183456    .0707609
         laglnnytimes |  -.0982936   .0321863    -3.05   0.002    -.1613776   -.0352096
        lagratpercent |  -.2997179   .1528433    -1.96   0.050    -.5992853   -.0001505
     lagdonor_physint |  -.0221594   .0337711    -0.66   0.512    -.0883495    .0440307
           lagpolity2 |   .0319693   .0059642     5.36   0.000     .0202796    .0436589
       laglneconaidpc |   .3852768   .0104312    36.93   0.000     .3648319    .4057216
       lnworldaidecon |   .9790695   .0336349    29.11   0.000     .9131463    1.044993
          lagln_rgdpc |  -.3439535   .0841434    -4.09   0.000    -.5088715   -.1790356
     lagln_population |   .4479054   .0559139     8.01   0.000     .3383162    .5574947
          lagln_trade |   .0771006   .0101944     7.56   0.000     .0571199    .0970813
          dyad_colony |   1.867914   .3713109     5.03   0.000     1.140158     2.59567
            socialist |  -.6229936    .202019    -3.08   0.002    -1.018943   -.2270437
              ColdWar |  -.0405848   .0796741    -0.51   0.610    -.1967431    .1155735
           coldwarsoc |   1.091554    .118998     9.17   0.000     .8583225    1.324786
               lagwar |  -.0639571   .0759057    -0.84   0.399    -.2127295    .0848153
             post2001 |    .120315   .0921804     1.31   0.192    -.0603552    .3009852
           region_SSA |    .915184   .2444667     3.74   0.000     .4360381     1.39433
         region_Latin |    .208284   .2514655     0.83   0.408    -.2845793    .7011474
          region_MENA |  -1.568152   .2938213    -5.34   0.000    -2.144032    -.992273
      region_EAsiaPac |   .1412347   .2612104     0.54   0.589    -.3707283    .6531978
                _cons |  -22.28018   1.222166   -18.23   0.000    -24.67558   -19.88478
----------------------+----------------------------------------------------------------
             /sigma_u |   2.476214   .0621114    39.87   0.000     2.354478     2.59795
             /sigma_e |   2.973099   .0192603   154.36   0.000     2.935349    3.010848
----------------------+----------------------------------------------------------------
                  rho |   .4095689   .0123842                      .3854844    .4339997
---------------------------------------------------------------------------------------
        20,586  left-censored observations
        14,648     uncensored observations
             0 right-censored observations

. 
. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
      noinit |     35,234         .  -44483.86      32    89031.73   89302.76
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. mat icsto = r(S)

. scalar aicsto = icsto[1,5]

. scalar bicsto = icsto[1,6]

. estadd scalar AIC = aicsto: noinit

. estadd scalar BIC = bicsto: noinit

. 
. unique countryname if e(sample)
Number of unique values of countryname is  100
Number of records is  35234

. estadd scalar countries = r(sum): noinit

. 
. unique donorname if e(sample)
Number of unique values of donorname is  21
Number of records is  35234

. estadd scalar donors = r(sum): noinit

. 
. unique dyadnum if e(sample)
Number of unique values of dyadnum is  2088
Number of records is  35234

. estadd scalar dyads= r(sum): noinit

. 
. tab year if e(sample)

       year |      Freq.     Percent        Cum.
------------+-----------------------------------
       1982 |      1,539        4.37        4.37
       1983 |      1,558        4.42        8.79
       1984 |      1,558        4.42       13.21
       1985 |      1,596        4.53       17.74
       1986 |      1,558        4.42       22.16
       1987 |      1,558        4.42       26.59
       1988 |      1,501        4.26       30.85
       1989 |      1,539        4.37       35.21
       1990 |      1,558        4.42       39.64
       1991 |      1,557        4.42       44.05
       1992 |      1,575        4.47       48.52
       1993 |      1,556        4.42       52.94
       1994 |      1,727        4.90       57.84
       1995 |      1,738        4.93       62.77
       1996 |      1,705        4.84       67.61
       1997 |      1,782        5.06       72.67
       1998 |      1,948        5.53       78.20
       1999 |      1,906        5.41       83.61
       2000 |      1,923        5.46       89.07
       2001 |      1,928        5.47       94.54
       2002 |      1,924        5.46      100.00
------------+-----------------------------------
      Total |     35,234      100.00

. 
. keep if e(sample)
(84,823 observations deleted)

. 
. * code source: http://www.stata.com/statalist/archive/2013-06/msg00457.html
. gen initlneconaidpc = laglneconaidpc

. bysort dyadnum (year): replace initlneconaidpc = initlneconaidpc[1]
(15,508 real changes made)

. 
. * the esarey-demeritt model
. eststo initcond:  xttobit lneconaidpc PUBRES lagXpub lagphysint lagalliance allXpub lagdonorallyneighbor2 neiXpub lags3un s3unXpub laglnreftotal laglnnytimes lagratper
> cent lagdonor_physint lagpolity2 laglneconaidpc lnworldaidecon lagln_rgdpc lagln_population lagln_trade dyad_colony socialist ColdWar coldwarsoc lagwar post2001 region
> _SSA region_Latin region_MENA region_EAsiaPac initlneconaidpc, ll(0) intpoints(19)

Obtaining starting values for full model:

Iteration 0:   log likelihood = -72182.283
Iteration 1:   log likelihood = -71615.938
Iteration 2:   log likelihood = -71282.409
Iteration 3:   log likelihood =   -71271.9
Iteration 4:   log likelihood = -71271.886

Fitting full model:

Iteration 0:   log likelihood = -53763.606  
Iteration 1:   log likelihood = -48743.776  
Iteration 2:   log likelihood = -44886.445  
Iteration 3:   log likelihood = -44379.623  
Iteration 4:   log likelihood = -44313.454  
Iteration 5:   log likelihood = -44312.405  
Iteration 6:   log likelihood = -44312.403  

Random-effects tobit regression                 Number of obs     =     35,234
Group variable: dyadnum                         Number of groups  =      2,088

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          1
                                                              avg =       16.9
                                                              max =         21

Integration method: mvaghermite                 Integration pts.  =         19

                                                Wald chi2(30)     =    5563.99
Log likelihood  = -44312.403                    Prob > chi2       =     0.0000

---------------------------------------------------------------------------------------
          lneconaidpc |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
----------------------+----------------------------------------------------------------
               PUBRES |  -1.630811   .2247318    -7.26   0.000    -2.071278   -1.190345
              lagXpub |   .2431533   .0333651     7.29   0.000     .1777589    .3085477
           lagphysint |  -.0596264   .0160355    -3.72   0.000    -.0910554   -.0281973
          lagalliance |   .2305095   .1955571     1.18   0.239    -.1527753    .6137944
              allXpub |   .0132735   .6269182     0.02   0.983    -1.215464     1.24201
lagdonorallyneighbor2 |  -.2835409   .1923018    -1.47   0.140    -.6604455    .0933638
              neiXpub |   .8894118   .2584253     3.44   0.001     .3829074    1.395916
              lags3un |   .1886871   .1750975     1.08   0.281    -.1544976    .5318718
             s3unXpub |   1.453957    .433812     3.35   0.001     .6037013    2.304213
        laglnreftotal |   .0500446   .0131585     3.80   0.000     .0242544    .0758347
         laglnnytimes |  -.0916091   .0318701    -2.87   0.004    -.1540735   -.0291448
        lagratpercent |  -.1865166    .146441    -1.27   0.203    -.4735358    .1005025
     lagdonor_physint |  -.0226243   .0335333    -0.67   0.500    -.0883483    .0430998
           lagpolity2 |   .0323439   .0058585     5.52   0.000     .0208615    .0438263
       laglneconaidpc |   .3705482   .0103006    35.97   0.000     .3503593     .390737
       lnworldaidecon |   .8602972   .0329586    26.10   0.000     .7956996    .9248949
          lagln_rgdpc |   -.253867   .0793292    -3.20   0.001    -.4093494   -.0983845
     lagln_population |   .4128886   .0510939     8.08   0.000     .3127464    .5130309
          lagln_trade |   .0669954   .0100119     6.69   0.000     .0473725    .0866183
          dyad_colony |    .955662   .3368388     2.84   0.005     .2954701    1.615854
            socialist |  -.0105595   .1884632    -0.06   0.955    -.3799406    .3588216
              ColdWar |  -.0675226   .0787455    -0.86   0.391    -.2218611    .0868158
           coldwarsoc |   1.113081   .1183015     9.41   0.000     .8812145    1.344948
               lagwar |  -.0703287     .07503    -0.94   0.349    -.2173847    .0767273
             post2001 |   .1399768   .0917391     1.53   0.127    -.0398285    .3197822
           region_SSA |   .7760458   .2221339     3.49   0.000     .3406713     1.21142
         region_Latin |   .3720926   .2279283     1.63   0.103    -.0746387    .8188238
          region_MENA |   -1.19861   .2681588    -4.47   0.000    -1.724191    -.673028
      region_EAsiaPac |   .2011516   .2362356     0.85   0.394    -.2618616    .6641648
      initlneconaidpc |   .4259484   .0224566    18.97   0.000     .3819343    .4699624
                _cons |  -21.23104   1.159361   -18.31   0.000    -23.50334   -18.95873
----------------------+----------------------------------------------------------------
             /sigma_u |   2.192228    .055624    39.41   0.000     2.083207    2.301249
             /sigma_e |   2.966471   .0191651   154.79   0.000     2.928908    3.004034
----------------------+----------------------------------------------------------------
                  rho |   .3532213   .0118003                      .3303767    .3766075
---------------------------------------------------------------------------------------
        20,586  left-censored observations
        14,648     uncensored observations
             0 right-censored observations

. 
. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
    initcond |     35,234         .   -44312.4      33    88690.81   88970.31
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. mat icsto = r(S)

. scalar aicsto = icsto[1,5]

. scalar bicsto = icsto[1,6]

. estadd scalar AIC = aicsto: initcond

. estadd scalar BIC = bicsto: initcond

. 
. scalar drop aicsto bicsto

. mat drop icsto

. 
. unique countryname if e(sample)
Number of unique values of countryname is  100
Number of records is  35234

. estadd scalar countries = r(sum): initcond

. 
. unique donorname if e(sample)
Number of unique values of donorname is  21
Number of records is  35234

. estadd scalar donors = r(sum): initcond

. 
. unique dyadnum if e(sample)
Number of unique values of dyadnum is  2088
Number of records is  35234

. estadd scalar dyads= r(sum): initcond

. 
. tab year if e(sample)

       year |      Freq.     Percent        Cum.
------------+-----------------------------------
       1982 |      1,539        4.37        4.37
       1983 |      1,558        4.42        8.79
       1984 |      1,558        4.42       13.21
       1985 |      1,596        4.53       17.74
       1986 |      1,558        4.42       22.16
       1987 |      1,558        4.42       26.59
       1988 |      1,501        4.26       30.85
       1989 |      1,539        4.37       35.21
       1990 |      1,558        4.42       39.64
       1991 |      1,557        4.42       44.05
       1992 |      1,575        4.47       48.52
       1993 |      1,556        4.42       52.94
       1994 |      1,727        4.90       57.84
       1995 |      1,738        4.93       62.77
       1996 |      1,705        4.84       67.61
       1997 |      1,782        5.06       72.67
       1998 |      1,948        5.53       78.20
       1999 |      1,906        5.41       83.61
       2000 |      1,923        5.46       89.07
       2001 |      1,928        5.47       94.54
       2002 |      1,924        5.46      100.00
------------+-----------------------------------
      Total |     35,234      100.00

. 
. esttab noinit initcond using "initcond.tex", title("Dyadic Bilateral Aid Flows, Varying Initial Condition Modeling*\label{tab:initcond-1}") longtable replace keep(lagl
> neconaidpc lagphysint PUBRES lagXpub initlneconaidpc lagalliance allXpub lagdonorallyneighbor2  neiXpub lags3un s3unXpub) order(PUBRES laglneconaidpc lagXpub initlneco
> naidpc lagphysint lagalliance allXpub lagdonorallyneighbor2 neiXpub lags3un s3unXpub) eqlabels(,none) nomtitles nodepvars coeflabels(laglneconaidpc  "DV\$_{i(t-1)}$" l
> agphysint  "Physical Integrity Violations\$_{i(t-1)}$" PUBRES "UNCHR Resolution\$_{i(t-1)}$" lagXpub "DV\$_{i(t-1)}$ * Resolution\$_{i(t-1)}$" initlneconaidpc "Initial
>  Value of lag DV" lagalliance "Alliance\$_{i(t-1)}$" lagalliance_physint "Alliance\$_{i(t-1)}$ * Violations\$_{i(t-1)}$" allXpub "Alliance\$_{i(t-1)}$ * Resolution\$_{
> i(t-1)}$" lagdonorallyneighbor2 "Ally Neighbor\$_{i(t-1)}$" lagallyneighbor2_physint "Ally Neighbor\$_{i(t-1)}$ * Violations\$_{i(t-1)}$" neiXpub "Ally Neighbor\$_{i(t
> -1)}$ * Resolution\$_{i(t-1)}$" lags3un "UN Voting Similarity\$_{i(t-1)}$" lags3un_physint "UN Similarity\$_{i(t-1)}$ * Violations\$_{i(t-1)}$" s3unXpub "UN Similarity
> \$_{i(t-1)}$ * Resolution\$_{i(t-1)}$") noabbrev wrap gaps varwidth(48) align(r) substitute(\_ _) stats(N dyads countries donors blank AIC BIC, labels("Observations" "
> Dyads" "Recipients" "Donors" " " "AIC" "BIC"))
(output written to initcond.tex)

. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. *****************************************************
. * Neilsen data
. * dyadic aid flow analysis
. * Lebovic/Voeten UNCHR condemnation variable
. * does donor respect for physint rights matter?
. *****************************************************
. 
. clear all

. set mem 1000M
set memory ignored.
    Memory no longer needs to be set in modern Statas; memory adjustments are performed on the fly automatically.

. set more off

. set matsize 800

. 
. 
. ** merge in public resolution data
. use jprworkdatanew.dta, clear

. rename YEAR year 

. rename CCODE countrynumcode_g

. save jpr_merge.dta, replace
file jpr_merge.dta saved

. 
. use "dat2.dta", clear

. 
. merge m:1 year countrynumcode_g year using jpr_merge.dta

    Result                           # of obs.
    -----------------------------------------
    not matched                        51,079
        from master                    50,316  (_merge==1)
        from using                        763  (_merge==2)

    matched                            69,741  (_merge==3)
    -----------------------------------------

. drop if _merge==2
(763 observations deleted)

. 
. tsset dyadnum year
       panel variable:  dyadnum (unbalanced)
        time variable:  year, 1980 to 2006, but with gaps
                delta:  1 unit

. 
. gen allXpub = PUBRES*l.alliance
(66,759 missing values generated)

. gen neiXpub = PUBRES*l.donorallyneighbor2
(66,633 missing values generated)

. gen s3unXpub = PUBRES*l.s3un
(66,693 missing values generated)

. 
. gen lagXpub = PUBRES*l.lneconaidpc
(66,864 missing values generated)

. 
. * interaction with donor physint?
. gen donorphysintXpub = PUBRES*l.donor_physint
(68,943 missing values generated)

. 
. eststo donormod: xttobit lneconaidpc PUBRES lagXpub l.donor_physint donorphysintXpub l.physint l.alliance l.donorallyneighbor2 l.s3un l.lnreftotal l.lnnytimes l.ratper
> cent l.polity2 l.lneconaidpc lnworldaidecon l.ln_rgdpc l.ln_population l.ln_trade dyad_colony socialist ColdWar coldwarsoc l.war post2001 region_SSA region_Latin regio
> n_MENA region_EAsiaPac if(inmysample==1), ll(0) intpoints(19)

Obtaining starting values for full model:

Iteration 0:   log likelihood = -73009.553
Iteration 1:   log likelihood = -71852.526
Iteration 2:   log likelihood = -71726.174
Iteration 3:   log likelihood = -71723.952
Iteration 4:   log likelihood =  -71723.95

Fitting full model:

Iteration 0:   log likelihood = -53506.753  
Iteration 1:   log likelihood = -47366.264  
Iteration 2:   log likelihood =  -44826.98  
Iteration 3:   log likelihood = -44551.123  
Iteration 4:   log likelihood = -44491.067  
Iteration 5:   log likelihood = -44490.929  
Iteration 6:   log likelihood = -44490.929  

Random-effects tobit regression                 Number of obs     =     35,234
Group variable: dyadnum                         Number of groups  =      2,088

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          1
                                                              avg =       16.9
                                                              max =         21

Integration method: mvaghermite                 Integration pts.  =         19

                                                Wald chi2(27)     =    4581.49
Log likelihood  = -44490.929                    Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
       lneconaidpc |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
            PUBRES |  -2.508635   .8700664    -2.88   0.004    -4.213934   -.8033362
           lagXpub |   .2362863   .0325517     7.26   0.000     .1724861    .3000864
                   |
     donor_physint |
               L1. |  -.0372099   .0348821    -1.07   0.286    -.1055775    .0311577
                   |
  donorphysintXpub |   .2107431    .115274     1.83   0.068    -.0151898     .436676
                   |
           physint |
               L1. |  -.0680685   .0161298    -4.22   0.000    -.0996824   -.0364546
                   |
          alliance |
               L1. |   .4101581   .2052057     2.00   0.046     .0079624    .8123539
                   |
donorallyneighbor2 |
               L1. |   .0350521   .2022951     0.17   0.862    -.3614391    .4315432
                   |
              s3un |
               L1. |   -.089599    .176623    -0.51   0.612    -.4357738    .2565757
                   |
        lnreftotal |
               L1. |   .0463476   .0133434     3.47   0.001      .020195    .0725003
                   |
         lnnytimes |
               L1. |  -.1030544   .0321724    -3.20   0.001    -.1661111   -.0399978
                   |
        ratpercent |
               L1. |  -.3046217   .1527323    -1.99   0.046    -.6039715    -.005272
                   |
           polity2 |
               L1. |   .0315532   .0059647     5.29   0.000     .0198625    .0432438
                   |
       lneconaidpc |
               L1. |   .3867279    .010426    37.09   0.000     .3662932    .4071625
                   |
    lnworldaidecon |   .9801347   .0336275    29.15   0.000      .914226    1.046043
                   |
          ln_rgdpc |
               L1. |  -.3562789   .0840577    -4.24   0.000    -.5210289   -.1915288
                   |
     ln_population |
               L1. |   .4572215   .0558108     8.19   0.000     .3478343    .5666087
                   |
          ln_trade |
               L1. |   .0772364   .0101989     7.57   0.000     .0572469     .097226
                   |
       dyad_colony |   1.861478   .3709296     5.02   0.000      1.13447    2.588487
         socialist |  -.6559476   .2014907    -3.26   0.001    -1.050862   -.2610331
           ColdWar |  -.0465979   .0796441    -0.59   0.558    -.2026975    .1095017
        coldwarsoc |   1.113279   .1185214     9.39   0.000     .8809808    1.345576
                   |
               war |
               L1. |   -.078439    .075841    -1.03   0.301    -.2270845    .0702066
                   |
          post2001 |   .1199129   .0922006     1.30   0.193     -.060797    .3006227
        region_SSA |    .917204    .244072     3.76   0.000     .4388316    1.395576
      region_Latin |   .2322708   .2510133     0.93   0.355    -.2597062    .7242478
       region_MENA |  -1.490149   .2923787    -5.10   0.000      -2.0632   -.9170969
   region_EAsiaPac |   .1292987   .2607374     0.50   0.620    -.3817372    .6403346
             _cons |     -22.21   1.223602   -18.15   0.000    -24.60821   -19.81178
-------------------+----------------------------------------------------------------
          /sigma_u |   2.473015   .0618946    39.96   0.000     2.351704    2.594326
          /sigma_e |    2.97407   .0192659   154.37   0.000      2.93631    3.011831
-------------------+----------------------------------------------------------------
               rho |   .4087859    .012348                      .3847728    .4331464
------------------------------------------------------------------------------------
        20,586  left-censored observations
        14,648     uncensored observations
             0 right-censored observations

. 
. 
. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
    donormod |     35,234         .  -44490.93      30    89041.86   89295.95
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. mat icsto = r(S)

. scalar aicsto = icsto[1,5]

. scalar bicsto = icsto[1,6]

. estadd scalar AIC = aicsto: donormod

. estadd scalar BIC = bicsto: donormod

. 
. scalar drop aicsto bicsto

. mat drop icsto

. 
. unique countryname if e(sample)
Number of unique values of countryname is  100
Number of records is  35234

. estadd scalar countries = r(sum): donormod

. 
. unique donorname if e(sample)
Number of unique values of donorname is  21
Number of records is  35234

. estadd scalar donors = r(sum): donormod

. 
. unique dyadnum if e(sample)
Number of unique values of dyadnum is  2088
Number of records is  35234

. estadd scalar dyads= r(sum): donormod

. 
. tab year if e(sample)

       year |      Freq.     Percent        Cum.
------------+-----------------------------------
       1982 |      1,539        4.37        4.37
       1983 |      1,558        4.42        8.79
       1984 |      1,558        4.42       13.21
       1985 |      1,596        4.53       17.74
       1986 |      1,558        4.42       22.16
       1987 |      1,558        4.42       26.59
       1988 |      1,501        4.26       30.85
       1989 |      1,539        4.37       35.21
       1990 |      1,558        4.42       39.64
       1991 |      1,557        4.42       44.05
       1992 |      1,575        4.47       48.52
       1993 |      1,556        4.42       52.94
       1994 |      1,727        4.90       57.84
       1995 |      1,738        4.93       62.77
       1996 |      1,705        4.84       67.61
       1997 |      1,782        5.06       72.67
       1998 |      1,948        5.53       78.20
       1999 |      1,906        5.41       83.61
       2000 |      1,923        5.46       89.07
       2001 |      1,928        5.47       94.54
       2002 |      1,924        5.46      100.00
------------+-----------------------------------
      Total |     35,234      100.00

. 
. eststo papermod: xttobit lneconaidpc PUBRES lagXpub l.donor_physint l.physint l.alliance l.donorallyneighbor2 l.s3un l.lnreftotal l.lnnytimes l.ratpercent l.polity2 l.
> lneconaidpc lnworldaidecon l.ln_rgdpc l.ln_population l.ln_trade dyad_colony socialist ColdWar coldwarsoc l.war post2001 region_SSA region_Latin region_MENA region_EAs
> iaPac if(inmysample==1), ll(0) intpoints(19)

Obtaining starting values for full model:

Iteration 0:   log likelihood = -73011.692
Iteration 1:   log likelihood = -71854.593
Iteration 2:   log likelihood = -71727.743
Iteration 3:   log likelihood = -71725.503
Iteration 4:   log likelihood =   -71725.5

Fitting full model:

Iteration 0:   log likelihood = -53507.586  
Iteration 1:   log likelihood =  -47365.68  
Iteration 2:   log likelihood = -44828.464  
Iteration 3:   log likelihood = -44552.783  
Iteration 4:   log likelihood = -44492.743  
Iteration 5:   log likelihood = -44492.606  
Iteration 6:   log likelihood = -44492.606  

Random-effects tobit regression                 Number of obs     =     35,234
Group variable: dyadnum                         Number of groups  =      2,088

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          1
                                                              avg =       16.9
                                                              max =         21

Integration method: mvaghermite                 Integration pts.  =         19

                                                Wald chi2(26)     =    4576.50
Log likelihood  = -44492.606                    Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
       lneconaidpc |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
            PUBRES |  -.9390143   .1382107    -6.79   0.000    -1.209902   -.6681262
           lagXpub |   .2353936   .0325531     7.23   0.000     .1715907    .2991965
                   |
     donor_physint |
               L1. |  -.0211667   .0337713    -0.63   0.531    -.0873573    .0450239
                   |
           physint |
               L1. |  -.0674436   .0161275    -4.18   0.000     -.099053   -.0358342
                   |
          alliance |
               L1. |     .41182   .2052431     2.01   0.045     .0095509    .8140892
                   |
donorallyneighbor2 |
               L1. |    .035882    .202344     0.18   0.859    -.3607049    .4324688
                   |
              s3un |
               L1. |  -.0902474   .1766462    -0.51   0.609    -.4364676    .2559727
                   |
        lnreftotal |
               L1. |   .0458403   .0133429     3.44   0.001     .0196887     .071992
                   |
         lnnytimes |
               L1. |  -.1027126   .0321763    -3.19   0.001     -.165777   -.0396482
                   |
        ratpercent |
               L1. |  -.3019315   .1527497    -1.98   0.048    -.6013154   -.0025476
                   |
           polity2 |
               L1. |   .0315169   .0059657     5.28   0.000     .0198243    .0432094
                   |
       lneconaidpc |
               L1. |   .3870217   .0104259    37.12   0.000     .3665872    .4074561
                   |
    lnworldaidecon |   .9804503   .0336316    29.15   0.000     .9145335    1.046367
                   |
          ln_rgdpc |
               L1. |  -.3532436   .0840599    -4.20   0.000    -.5179979   -.1884892
                   |
     ln_population |
               L1. |   .4575412   .0558277     8.20   0.000     .3481208    .5669615
                   |
          ln_trade |
               L1. |   .0768664   .0101975     7.54   0.000     .0568796    .0968531
                   |
       dyad_colony |   1.855619   .3710135     5.00   0.000     1.128446    2.582792
         socialist |  -.6575891   .2015381    -3.26   0.001    -1.052597   -.2625817
           ColdWar |  -.0458422   .0796498    -0.58   0.565     -.201953    .1102685
        coldwarsoc |   1.115373   .1185207     9.41   0.000     .8830769     1.34767
                   |
               war |
               L1. |  -.0777671   .0758454    -1.03   0.305    -.2264213    .0708872
                   |
          post2001 |    .120234   .0922074     1.30   0.192    -.0604891    .3009572
        region_SSA |   .9189126   .2441342     3.76   0.000     .4404183    1.397407
      region_Latin |    .232809   .2510819     0.93   0.354    -.2593024    .7249204
       region_MENA |  -1.491078   .2924621    -5.10   0.000    -2.064293    -.917863
   region_EAsiaPac |   .1291553   .2608072     0.50   0.620    -.3820174    .6403281
             _cons |  -22.36134   1.221158   -18.31   0.000    -24.75476   -19.96791
-------------------+----------------------------------------------------------------
          /sigma_u |   2.473806    .061915    39.95   0.000     2.352455    2.595157
          /sigma_e |   2.974314   .0192677   154.37   0.000      2.93655    3.012078
-------------------+----------------------------------------------------------------
               rho |   .4089008   .0123492                      .3848851    .4332635
------------------------------------------------------------------------------------
        20,586  left-censored observations
        14,648     uncensored observations
             0 right-censored observations

. 
. 
. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
    papermod |     35,234         .  -44492.61      29    89043.21   89288.83
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. mat icsto = r(S)

. scalar aicsto = icsto[1,5]

. scalar bicsto = icsto[1,6]

. estadd scalar AIC = aicsto: papermod

. estadd scalar BIC = bicsto: papermod

. 
. scalar drop aicsto bicsto

. mat drop icsto

. 
. unique countryname if e(sample)
Number of unique values of countryname is  100
Number of records is  35234

. estadd scalar countries = r(sum): papermod

. 
. unique donorname if e(sample)
Number of unique values of donorname is  21
Number of records is  35234

. estadd scalar donors = r(sum): papermod

. 
. unique dyadnum if e(sample)
Number of unique values of dyadnum is  2088
Number of records is  35234

. estadd scalar dyads= r(sum): papermod

. 
. tab year if e(sample)

       year |      Freq.     Percent        Cum.
------------+-----------------------------------
       1982 |      1,539        4.37        4.37
       1983 |      1,558        4.42        8.79
       1984 |      1,558        4.42       13.21
       1985 |      1,596        4.53       17.74
       1986 |      1,558        4.42       22.16
       1987 |      1,558        4.42       26.59
       1988 |      1,501        4.26       30.85
       1989 |      1,539        4.37       35.21
       1990 |      1,558        4.42       39.64
       1991 |      1,557        4.42       44.05
       1992 |      1,575        4.47       48.52
       1993 |      1,556        4.42       52.94
       1994 |      1,727        4.90       57.84
       1995 |      1,738        4.93       62.77
       1996 |      1,705        4.84       67.61
       1997 |      1,782        5.06       72.67
       1998 |      1,948        5.53       78.20
       1999 |      1,906        5.41       83.61
       2000 |      1,923        5.46       89.07
       2001 |      1,928        5.47       94.54
       2002 |      1,924        5.46      100.00
------------+-----------------------------------
      Total |     35,234      100.00

. 
. 
. 
. esttab papermod donormod using "physint.tex", title("State-dependence in Dyadic Bilateral Aid Flows with Donor Physical Integrity Score Interactions*\label{tab:physint
> }") longtable replace keep(L.lneconaidpc L.physint PUBRES lagXpub L.donor_physint donorphysintXpub L.alliance L.donorallyneighbor2 L.s3un) order(L.lneconaidpc L.physin
> t PUBRES lagXpub L.donor_physint donorphysintXpub L.alliance L.donorallyneighbor2 L.s3un) eqlabels(,none) nomtitles nodepvars coeflabels(L.lneconaidpc  "DV\$_{i(t-1)}$
> " L.physint  "Physical Integrity Violations\$_{i(t-1)}$" PUBRES "UNCHR Resolution\$_{i(t-1)}$" lagXpub "DV\$_{i(t-1)}$ * Resolution\$_{i(t-1)}$" L.donor_physint "Donor
>  Violations\$_{i(t-1)}$" donorphysintXpub "Donor Violations\$_{i(t-1)}$ * Resolution\$_{i(t-1)}$"  L.alliance "Alliance\$_{i(t-1)}$" L.donorallyneighbor2 "Ally Neighbo
> r\$_{i(t-1)}$" L.s3un "UN Voting Similarity\$_{i(t-1)}$") noabbrev wrap gaps varwidth(65) align(r) substitute(\_ _) stats(N dyads countries donors blank AIC BIC, label
> s("Observations" "Dyads" "Recipients" "Donors" " " "AIC" "BIC"))
(output written to physint.tex)

. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. *****************************************************
. * Neilsen data
. * dyadic aid flow analysis
. * Murdie/Davis NGO Shaming variable
. * does donor level of shaming matter?
. *****************************************************
. 
. 
. clear all

. set more off

. set matsize 800

. 
. 
. ** merge in NGO data
. use "ISQ 2010 Murdie Davis final to ISQ.dta", clear

. rename cowcode countrynumcode_g

. rename NAMES_STD donorname

. save murdie_merge.dta, replace
file murdie_merge.dta saved

. 
. ** merge in NGO data
. use "ISQ 2010 Murdie Davis final to ISQ.dta", clear

. rename country donorname

. rename HRnc2gcnc2 donor_shaming

. keep if donorname == "Australia" | donorname == "Austria" | donorname == "Belgium" | donorname == "Canada" | donorname == "Denmark" | donorname == "Finland" | donornam
> e == "France" | donorname == "Germany" | donorname == "Ireland" | donorname == "Italy" | donorname == "Japan" | donorname == "Luxembourg" | donorname == "Netherlands" 
> | donorname == "New Zealand" | donorname == "Norway" | donorname == "Portugal" | donorname == "Spain" | donorname == "Sweden" | donorname == "Switzerland" | donorname 
> == "United Kingdom" | donorname == "United States"
(7,480 observations deleted)

. save murdie_merge_2.dta, replace
file murdie_merge_2.dta saved

. 
. ** merge in public resolution data
. use jprworkdatanew.dta, clear

. rename YEAR year 

. rename CCODE countrynumcode_g

. save jpr_merge.dta, replace
file jpr_merge.dta saved

. 
. use "dat2.dta", clear

. 
. merge m:1 year countrynumcode_g year using murdie_merge.dta
(note: variable year was int, now double to accommodate using data's values)
(note: variable countrynumcode_g was int, now float to accommodate using data's values)
(note: variable donorname was str14, now str32 to accommodate using data's values)

    Result                           # of obs.
    -----------------------------------------
    not matched                        15,749
        from master                    12,096  (_merge==1)
        from using                      3,653  (_merge==2)

    matched                           107,961  (_merge==3)
    -----------------------------------------

. drop if _merge==2
(3,653 observations deleted)

. drop _merge

. 
. merge m:1 donorname year using murdie_merge_2.dta, keepusing(donor_shaming)
(note: variable donorname was str32, now str44 to accommodate using data's values)
(label ucdp_loc already defined)
(label ucdp_type1 already defined)
(label ucdp_type2 already defined)
(label ucdp_type3 already defined)
(label ucdp_type4 already defined)

    Result                           # of obs.
    -----------------------------------------
    not matched                         5,837
        from master                     5,717  (_merge==1)
        from using                        120  (_merge==2)

    matched                           114,340  (_merge==3)
    -----------------------------------------

. drop if _merge==2
(120 observations deleted)

. drop _merge

. 
. merge m:1 year countrynumcode_g year using jpr_merge.dta

    Result                           # of obs.
    -----------------------------------------
    not matched                        51,079
        from master                    50,316  (_merge==1)
        from using                        763  (_merge==2)

    matched                            69,741  (_merge==3)
    -----------------------------------------

. drop if _merge==2
(763 observations deleted)

. 
. tsset dyadnum year
       panel variable:  dyadnum (unbalanced)
        time variable:  year, 1980 to 2006, but with gaps
                delta:  1 unit

. 
. * no interactions
. eststo shamedonors: tobit lneconaidpc L.HRnc2gcnc2 l.physint l.alliance l.donorallyneighbor2 l.s3un l.lnreftotal l.lnnytimes l.ratpercent l.donor_physint l.polity2 l.l
> neconaidpc lnworldaidecon l.ln_rgdpc l.ln_population l.ln_trade dyad_colony socialist l.war post2001 region_SSA region_Latin region_MENA region_EAsiaPac if(inmysample=
> =1 & L.donor_shaming>=1), ll(0) cluster(dyadnum)

Tobit regression                                Number of obs     =      6,748
                                                F(  23,   6725)   =     223.89
                                                Prob > F          =     0.0000
Log pseudolikelihood = -11619.753               Pseudo R2         =     0.2143

                                  (Std. Err. adjusted for 1,840 clusters in dyadnum)
------------------------------------------------------------------------------------
                   |               Robust
       lneconaidpc |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
        HRnc2gcnc2 |
               L1. |   .0033321   .0228057     0.15   0.884    -.0413743    .0480384
                   |
           physint |
               L1. |  -.0303529   .0262771    -1.16   0.248    -.0818643    .0211585
                   |
          alliance |
               L1. |   .6242983   .1231632     5.07   0.000     .3828595     .865737
                   |
donorallyneighbor2 |
               L1. |   .2972947   .1287875     2.31   0.021     .0448303     .549759
                   |
              s3un |
               L1. |    .182809   .1661972     1.10   0.271    -.1429901    .5086081
                   |
        lnreftotal |
               L1. |   .0097458   .0208052     0.47   0.639     -.031039    .0505305
                   |
         lnnytimes |
               L1. |   .0150738   .0463489     0.33   0.745    -.0757847    .1059322
                   |
        ratpercent |
               L1. |   .3799564   .1965677     1.93   0.053    -.0053786    .7652913
                   |
     donor_physint |
               L1. |   .0734857   .0446792     1.64   0.100    -.0140996     .161071
                   |
           polity2 |
               L1. |   .0272421     .00803     3.39   0.001     .0115007    .0429835
                   |
       lneconaidpc |
               L1. |    .778154   .0199846    38.94   0.000     .7389779    .8173301
                   |
    lnworldaidecon |   .4755429   .0340569    13.96   0.000     .4087807    .5423052
                   |
          ln_rgdpc |
               L1. |  -.4741808    .073898    -6.42   0.000    -.6190444   -.3293173
                   |
     ln_population |
               L1. |   .1043468   .0431319     2.42   0.016     .0197946    .1888991
                   |
          ln_trade |
               L1. |   .0470411   .0159119     2.96   0.003     .0158487    .0782334
                   |
       dyad_colony |   .3981186   .1676899     2.37   0.018     .0693933    .7268439
         socialist |  -.0169346   .1000229    -0.17   0.866    -.2130113     .179142
                   |
               war |
               L1. |  -.0477839    .103961    -0.46   0.646    -.2515804    .1560126
                   |
          post2001 |   .3239974   .0691923     4.68   0.000     .1883585    .4596363
        region_SSA |   .4232986   .1451423     2.92   0.004     .1387738    .7078234
      region_Latin |   .4193494   .1371071     3.06   0.002     .1505761    .6881227
       region_MENA |  -.1625304    .206121    -0.79   0.430    -.5665929    .2415321
   region_EAsiaPac |   .2865496   .1498188     1.91   0.056    -.0071427    .5802418
             _cons |  -9.270315   1.059591    -8.75   0.000    -11.34745   -7.193181
-------------------+----------------------------------------------------------------
            /sigma |   2.626982   .0586176                      2.512073    2.741891
------------------------------------------------------------------------------------
         2,424  left-censored observations at lneconaidpc <= 0
         4,324     uncensored observations
             0 right-censored observations

. 
. 
. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
 shamedonors |      6,748 -14788.73  -11619.75      25    23289.51   23459.93
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. mat icsto = r(S)

. scalar aicsto = icsto[1,5]

. scalar bicsto = icsto[1,6]

. estadd scalar AIC = aicsto: shamedonors

. estadd scalar BIC = bicsto: shamedonors

. 
. scalar drop aicsto bicsto

. mat drop icsto

. 
. 
. tab year if e(sample)

       year |      Freq.     Percent        Cum.
------------+-----------------------------------
       1993 |        182        2.70        2.70
       1994 |        102        1.51        4.21
       1995 |        400        5.93       10.14
       1996 |        412        6.11       16.24
       1997 |        537        7.96       24.20
       1998 |        752       11.14       35.34
       1999 |        526        7.79       43.14
       2000 |        208        3.08       46.22
       2001 |        745       11.04       57.26
       2002 |        955       14.15       71.41
       2003 |      1,066       15.80       87.21
       2004 |        863       12.79      100.00
------------+-----------------------------------
      Total |      6,748      100.00

. 
. unique countryname if e(sample)
Number of unique values of countryname is  110
Number of records is  6748

. estadd scalar countries = r(sum): shamedonors

. 
. unique donorname if e(sample)
Number of unique values of donorname is  17
Number of records is  6748

. estadd scalar donors = r(sum): shamedonors

. 
. unique dyadnum if e(sample)
Number of unique values of dyadnum is  1840
Number of records is  6748

. estadd scalar dyads= r(sum): shamedonors

. 
. 
. 
. gen allXngo = l.HRnc2gcnc2*l.alliance
(78,246 missing values generated)

. gen neiXngo = l.HRnc2gcnc2*l.donorallyneighbor2
(63,441 missing values generated)

. gen s3unXngo = l.HRnc2gcnc2*l.s3un
(67,968 missing values generated)

. 
. gen lagXngo = l.HRnc2gcnc2*l.lneconaidpc
(76,209 missing values generated)

. 
. * lag interaction with PUBRES only
. eststo shamedonors2: tobit lneconaidpc L.HRnc2gcnc2 lagXngo l.physint l.alliance l.donorallyneighbor2 l.s3un l.lnreftotal l.lnnytimes l.ratpercent l.donor_physint l.po
> lity2 l.lneconaidpc lnworldaidecon l.ln_rgdpc l.ln_population l.ln_trade dyad_colony socialist l.war post2001 region_SSA region_Latin region_MENA region_EAsiaPac if(in
> mysample==1 & L.donor_shaming>=1), ll(0) cluster(dyadnum)

Tobit regression                                Number of obs     =      6,748
                                                F(  24,   6724)   =     214.80
                                                Prob > F          =     0.0000
Log pseudolikelihood = -11618.613               Pseudo R2         =     0.2144

                                  (Std. Err. adjusted for 1,840 clusters in dyadnum)
------------------------------------------------------------------------------------
                   |               Robust
       lneconaidpc |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
        HRnc2gcnc2 |
               L1. |  -.0447682    .045229    -0.99   0.322    -.1334315     .043895
                   |
           lagXngo |   .0117713   .0091385     1.29   0.198    -.0061431    .0296857
                   |
           physint |
               L1. |  -.0303849   .0262895    -1.16   0.248    -.0819207    .0211508
                   |
          alliance |
               L1. |    .627345   .1236891     5.07   0.000     .3848752    .8698149
                   |
donorallyneighbor2 |
               L1. |   .3049962   .1290439     2.36   0.018     .0520294    .5579631
                   |
              s3un |
               L1. |   .1730863   .1636273     1.06   0.290     -.147675    .4938476
                   |
        lnreftotal |
               L1. |   .0093948   .0208328     0.45   0.652     -.031444    .0502336
                   |
         lnnytimes |
               L1. |   .0157681   .0461546     0.34   0.733    -.0747095    .1062457
                   |
        ratpercent |
               L1. |    .386824    .194648     1.99   0.047     .0052523    .7683957
                   |
     donor_physint |
               L1. |   .0745599   .0447167     1.67   0.095    -.0130991    .1622189
                   |
           polity2 |
               L1. |   .0276064   .0080179     3.44   0.001     .0118887     .043324
                   |
       lneconaidpc |
               L1. |   .7730904   .0200877    38.49   0.000     .7337121    .8124687
                   |
    lnworldaidecon |    .473344   .0340225    13.91   0.000      .406649    .5400389
                   |
          ln_rgdpc |
               L1. |  -.4762074   .0740622    -6.43   0.000    -.6213927   -.3310221
                   |
     ln_population |
               L1. |    .106083   .0429199     2.47   0.013     .0219465    .1902195
                   |
          ln_trade |
               L1. |   .0470964   .0159229     2.96   0.003     .0158825    .0783103
                   |
       dyad_colony |   .4074631   .1674069     2.43   0.015     .0792926    .7356336
         socialist |  -.0153841   .1000415    -0.15   0.878     -.211497    .1807289
                   |
               war |
               L1. |  -.0487184   .1038052    -0.47   0.639    -.2522096    .1547727
                   |
          post2001 |   .3300671   .0691047     4.78   0.000        .1946    .4655342
        region_SSA |   .4270693   .1456966     2.93   0.003     .1414578    .7126807
      region_Latin |   .4244037   .1375032     3.09   0.002     .1548539    .6939535
       region_MENA |  -.1610009   .2056342    -0.78   0.434     -.564109    .2421073
   region_EAsiaPac |   .2874683    .150149     1.91   0.056    -.0068713    .5818078
             _cons |  -9.219959    1.05926    -8.70   0.000    -11.29644   -7.143474
-------------------+----------------------------------------------------------------
            /sigma |   2.625981   .0586043                      2.511098    2.740864
------------------------------------------------------------------------------------
         2,424  left-censored observations at lneconaidpc <= 0
         4,324     uncensored observations
             0 right-censored observations

. 
. 
. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
shamedonors2 |      6,748 -14788.73  -11618.61      26    23289.23   23466.47
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. mat icsto = r(S)

. scalar aicsto = icsto[1,5]

. scalar bicsto = icsto[1,6]

. estadd scalar AIC = aicsto: shamedonors2

. estadd scalar BIC = bicsto: shamedonors2

. 
. scalar drop aicsto bicsto

. mat drop icsto

. 
. 
. tab year if e(sample)

       year |      Freq.     Percent        Cum.
------------+-----------------------------------
       1993 |        182        2.70        2.70
       1994 |        102        1.51        4.21
       1995 |        400        5.93       10.14
       1996 |        412        6.11       16.24
       1997 |        537        7.96       24.20
       1998 |        752       11.14       35.34
       1999 |        526        7.79       43.14
       2000 |        208        3.08       46.22
       2001 |        745       11.04       57.26
       2002 |        955       14.15       71.41
       2003 |      1,066       15.80       87.21
       2004 |        863       12.79      100.00
------------+-----------------------------------
      Total |      6,748      100.00

. 
. unique countryname if e(sample)
Number of unique values of countryname is  110
Number of records is  6748

. estadd scalar countries = r(sum): shamedonors2

. 
. unique donorname if e(sample)
Number of unique values of donorname is  17
Number of records is  6748

. estadd scalar donors = r(sum): shamedonors2

. 
. unique dyadnum if e(sample)
Number of unique values of dyadnum is  1840
Number of records is  6748

. estadd scalar dyads= r(sum): shamedonors2

. 
. 
. gen donorshamingXngo = l.HRnc2gcnc2*L.donor_shaming
(65,041 missing values generated)

. 
. 
. * interaction with donor shaming
. eststo shamedonorsint: tobit lneconaidpc L.HRnc2gcnc2 L.donor_shaming donorshamingXngo l.physint l.alliance l.donorallyneighbor2 l.s3un l.lnreftotal l.lnnytimes l.ratp
> ercent l.donor_physint l.polity2 l.lneconaidpc lnworldaidecon l.ln_rgdpc l.ln_population l.ln_trade dyad_colony socialist l.war post2001 region_SSA region_Latin region
> _MENA region_EAsiaPac if(inmysample==1), ll(0) cluster(dyadnum)

Tobit regression                                Number of obs     =     23,130
                                                F(  25,  23105)   =     387.58
                                                Prob > F          =     0.0000
Log pseudolikelihood = -30051.389               Pseudo R2         =     0.2585

                                  (Std. Err. adjusted for 2,198 clusters in dyadnum)
------------------------------------------------------------------------------------
                   |               Robust
       lneconaidpc |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
        HRnc2gcnc2 |
               L1. |   .0466862   .0183909     2.54   0.011     .0106389    .0827336
                   |
     donor_shaming |
               L1. |  -.0124864   .0075508    -1.65   0.098    -.0272864    .0023137
                   |
  donorshamingXngo |  -.0033762   .0029196    -1.16   0.248    -.0090989    .0023464
                   |
           physint |
               L1. |  -.0323036   .0186602    -1.73   0.083    -.0688789    .0042717
                   |
          alliance |
               L1. |   .3999473   .1115927     3.58   0.000     .1812182    .6186764
                   |
donorallyneighbor2 |
               L1. |   .2360535   .1130795     2.09   0.037     .0144101    .4576968
                   |
              s3un |
               L1. |  -.1771325   .1455864    -1.22   0.224    -.4624915    .1082265
                   |
        lnreftotal |
               L1. |   .0577899   .0145389     3.97   0.000     .0292926    .0862871
                   |
         lnnytimes |
               L1. |  -.0398521   .0334431    -1.19   0.233    -.1054028    .0256986
                   |
        ratpercent |
               L1. |   .3007122    .122612     2.45   0.014     .0603845    .5410399
                   |
     donor_physint |
               L1. |  -.0120784   .0407294    -0.30   0.767    -.0919107    .0677539
                   |
           polity2 |
               L1. |   .0366762   .0065448     5.60   0.000      .023848    .0495044
                   |
       lneconaidpc |
               L1. |   .8775138   .0145207    60.43   0.000     .8490524    .9059753
                   |
    lnworldaidecon |   .4702938   .0230307    20.42   0.000     .4251521    .5154355
                   |
          ln_rgdpc |
               L1. |  -.4176711   .0600297    -6.96   0.000    -.5353332    -.300009
                   |
     ln_population |
               L1. |   .2114518   .0339914     6.22   0.000     .1448265    .2780772
                   |
          ln_trade |
               L1. |   .0402496    .011789     3.41   0.001     .0171424    .0633568
                   |
       dyad_colony |   .3826187   .1300397     2.94   0.003     .1277321    .6375052
         socialist |   .0688161   .0927029     0.74   0.458    -.1128878    .2505201
                   |
               war |
               L1. |  -.0750303   .0760502    -0.99   0.324    -.2240937    .0740331
                   |
          post2001 |   .0043655   .0481758     0.09   0.928    -.0900623    .0987933
        region_SSA |   .4824826   .1291567     3.74   0.000     .2293268    .7356383
      region_Latin |   .4728539   .1184731     3.99   0.000     .2406386    .7050691
       region_MENA |  -.1785184    .177701    -1.00   0.315    -.5268242    .1697874
   region_EAsiaPac |   .4469132    .124526     3.59   0.000     .2028339    .6909925
             _cons |  -10.35299   .8416786   -12.30   0.000    -12.00274   -8.703244
-------------------+----------------------------------------------------------------
            /sigma |   2.855469   .0461449                      2.765022    2.945916
------------------------------------------------------------------------------------
        12,791  left-censored observations at lneconaidpc <= 0
        10,339     uncensored observations
             0 right-censored observations

. 
. 
. estat ic

Akaike's information criterion and Bayesian information criterion

-----------------------------------------------------------------------------
       Model |        Obs  ll(null)  ll(model)      df         AIC        BIC
-------------+---------------------------------------------------------------
shamedonor~t |     23,130 -40526.88  -30051.39      27    60156.78    60374.1
-----------------------------------------------------------------------------
               Note: N=Obs used in calculating BIC; see [R] BIC note.

. mat icsto = r(S)

. scalar aicsto = icsto[1,5]

. scalar bicsto = icsto[1,6]

. estadd scalar AIC = aicsto: shamedonorsint

. estadd scalar BIC = bicsto: shamedonorsint

. 
. scalar drop aicsto bicsto

. mat drop icsto

. 
. 
. tab year if e(sample)

       year |      Freq.     Percent        Cum.
------------+-----------------------------------
       1993 |      1,671        7.22        7.22
       1994 |      1,887        8.16       15.38
       1995 |      1,808        7.82       23.20
       1996 |      1,868        8.08       31.28
       1997 |      1,940        8.39       39.66
       1998 |      2,156        9.32       48.98
       1999 |      2,116        9.15       58.13
       2000 |      2,049        8.86       66.99
       2001 |      2,033        8.79       75.78
       2002 |      2,033        8.79       84.57
       2003 |      2,033        8.79       93.36
       2004 |      1,536        6.64      100.00
------------+-----------------------------------
      Total |     23,130      100.00

. 
. unique countryname if e(sample)
Number of unique values of countryname is  110
Number of records is  23130

. estadd scalar countries = r(sum): shamedonorsint

. 
. unique donorname if e(sample)
Number of unique values of donorname is  20
Number of records is  23130

. estadd scalar donors = r(sum): shamedonorsint

. 
. unique dyadnum if e(sample)
Number of unique values of dyadnum is  2198
Number of records is  23130

. estadd scalar dyads= r(sum): shamedonorsint

. 
. 
. 
. esttab shamedonors shamedonors2 using "shame-donor-tobits.tex", title("Dyadic Bilateral Economic Aid Flows, Murdie and Davis (2012) NGO Shaming Measure Among Shamed Do
> nors*\label{tab:shamedonors}") longtable replace order(L.lneconaidpc L.physint L.HRnc2gcnc2 lagXngo L.alliance L.donorallyneighbor2 L.s3un) keep(L.lneconaidpc L.HRnc2g
> cnc2 lagXngo L.physint L.alliance L.donorallyneighbor2 L.s3un) eqlabels(,none) nomtitles nodepvars coeflabels(L.lneconaidpc "DV\$_{i(t-1)}$" L.physint "Physical Integr
> ity Violations\$\_{i(t-1)}$" L.HRnc2gcnc2 "NGO Shaming\$\_{i(t-1)}$" lagXngo "DV\$\_{i(t-1)}$ * NGO Shaming\$\_{i(t-1)}$" L.alliance "Alliance\$\_{i(t-1)}$" L.donorall
> yneighbor2 "Ally Neighbor\$\_{i(t-1)}$" L.s3un "UN Voting Similarity\$\_{i(t-1)}$") noabbrev wrap gaps varwidth(45) align(r) substitute(\_ _) stats(N dyads countries d
> onors blank AIC BIC, labels("Observations" "Dyads" "Recipients" "Donors" " " "AIC" "BIC"))
(output written to shame-donor-tobits.tex)

. 
. 
. esttab shamedonorsint using "shame-donor-int-tobits.tex", title("Dyadic Bilateral Economic Aid Flows, Murdie and Davis (2012) NGO Shaming Measure with Donor Shaming In
> teraction*\label{tab:shamedonorsinteraction}") longtable replace order(L.lneconaidpc L.physint L.HRnc2gcnc2 L.donor_shaming donorshamingXngo L.alliance L.donorallyneig
> hbor2 L.s3un) keep(L.lneconaidpc L.HRnc2gcnc2 L.donor_shaming donorshamingXngo L.physint L.alliance L.donorallyneighbor2 L.s3un) eqlabels(,none) nomtitles nodepvars co
> eflabels(L.lneconaidpc "DV\$_{i(t-1)}$" L.physint "Physical Integrity Violations\$\_{i(t-1)}$" L.HRnc2gcnc2 "NGO Shaming\$\_{i(t-1)}$"L.donor_shaming "Donor NGO Shamin
> g\$\_{i(t-1)} \geq 1$" donorshamingXngo "Donor NGO Shaming\$\_{i(t-1)} \geq 1$ * NGO Shaming\$\_{i(t-1)}$" L.alliance "Alliance\$\_{i(t-1)}$" L.donorallyneighbor2 "All
> y Neighbor\$\_{i(t-1)}$" L.s3un "UN Voting Similarity\$\_{i(t-1)}$") noabbrev wrap gaps varwidth(45) align(r) substitute(\_ _) stats(N dyads countries donors blank AIC
>  BIC, labels("Observations" "Dyads" "Recipients" "Donors" " " "AIC" "BIC"))
(output written to shame-donor-int-tobits.tex)

. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. *****************************************************
. * Reviewer table only
. * Neilsen data
. * dyadic aid per log GDP flow analysis
. * Lebovic/Voeten UNCHR condemnation variable
. *****************************************************
. 
. * create common sample for old and new models
. 
. clear all

. set mem 1000M
set memory ignored.
    Memory no longer needs to be set in modern Statas; memory adjustments are performed on the fly automatically.

. set more off

. set matsize 800

. 
. 
. ** merge in public resolution data
. use jprworkdatanew.dta, clear

. rename YEAR year 

. rename CCODE countrynumcode_g

. save jpr_merge.dta, replace
file jpr_merge.dta saved

. 
. use "dat2.dta", clear

. 
. merge m:1 year countrynumcode_g year using jpr_merge.dta

    Result                           # of obs.
    -----------------------------------------
    not matched                        51,079
        from master                    50,316  (_merge==1)
        from using                        763  (_merge==2)

    matched                            69,741  (_merge==3)
    -----------------------------------------

. drop if _merge==2
(763 observations deleted)

. 
. tsset dyadnum year
       panel variable:  dyadnum (unbalanced)
        time variable:  year, 1980 to 2006, but with gaps
                delta:  1 unit

. 
. gen allXpub = PUBRES*l.alliance
(66,759 missing values generated)

. gen neiXpub = PUBRES*l.donorallyneighbor2
(66,633 missing values generated)

. gen s3unXpub = PUBRES*l.s3un
(66,693 missing values generated)

. 
. gen lneconaidpcbygdp = log( (exp(lneconaidpc)-1) / exp(ln_rgdpc) + 1)
(35,847 missing values generated)

. 
. gen lagXpub = PUBRES*l.lneconaidpcbygdp
(66,864 missing values generated)

. 
. 
. * the neilsen model
. eststo neilsen: xttobit lneconaidpcbygdp l.physint l.alliance l.alliance_physint l.donorallyneighbor2 l.allyneighbor2_physint l.s3un l.s3un_physint l.lnreftotal l.lnre
> ftotal_physint l.lnnytimes l.lnnytimes_physint l.ratpercent l.ratpercent_physint l.donor_physint l.donor_physint_physint l.polity2 l.lneconaidpcbygdp lnworldaidecon l.
> ln_population l.ln_trade dyad_colony socialist ColdWar coldwarsoc l.ColdWar_physint l.war post2001 region_SSA region_Latin region_MENA region_EAsiaPac if(inmysample==1
> ), ll(0) intpoints(20)

Obtaining starting values for full model:

Iteration 0:   log likelihood = -6899.6505
Iteration 1:   log likelihood = -5267.1284
Iteration 2:   log likelihood = -5159.7288
Iteration 3:   log likelihood = -5158.5555
Iteration 4:   log likelihood = -5158.5552

Fitting full model:

Iteration 0:   log likelihood = -25557.097  
Iteration 1:   log likelihood = -20471.537  
Iteration 2:   log likelihood = -16937.997  
Iteration 3:   log likelihood = -16539.572  
Iteration 4:   log likelihood = -16451.244  
Iteration 5:   log likelihood = -16450.538  
Iteration 6:   log likelihood = -16450.537  

Random-effects tobit regression                 Number of obs     =     41,935
Group variable: dyadnum                         Number of groups  =      2,364

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          1
                                                              avg =       17.7
                                                              max =         22

Integration method: mvaghermite                 Integration pts.  =         20

                                                Wald chi2(31)     =    3452.78
Log likelihood  = -16450.537                    Prob > chi2       =     0.0000

---------------------------------------------------------------------------------------
     lneconaidpcbygdp |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
----------------------+----------------------------------------------------------------
              physint |
                  L1. |  -.0263146   .0142074    -1.85   0.064    -.0541607    .0015315
                      |
             alliance |
                  L1. |  -.0054623   .0335813    -0.16   0.871    -.0712803    .0603558
                      |
     alliance_physint |
                  L1. |   .0170575   .0065066     2.62   0.009     .0043049    .0298102
                      |
   donorallyneighbor2 |
                  L1. |   .1206909    .034304     3.52   0.000     .0534563    .1879255
                      |
allyneighbor2_physint |
                  L1. |  -.0091827   .0053536    -1.72   0.086    -.0196756    .0013102
                      |
                 s3un |
                  L1. |  -.1022067   .0342964    -2.98   0.003    -.1694265   -.0349869
                      |
         s3un_physint |
                  L1. |   .0175046   .0068054     2.57   0.010     .0041663    .0308428
                      |
           lnreftotal |
                  L1. |   .0004548   .0029712     0.15   0.878    -.0053687    .0062782
                      |
   lnreftotal_physint |
                  L1. |   .0002192   .0005291     0.41   0.679    -.0008178    .0012562
                      |
            lnnytimes |
                  L1. |   .0000521   .0076618     0.01   0.995    -.0149647     .015069
                      |
    lnnytimes_physint |
                  L1. |  -.0025293   .0013765    -1.84   0.066    -.0052272    .0001687
                      |
           ratpercent |
                  L1. |  -.1160007   .0300984    -3.85   0.000    -.1749925   -.0570088
                      |
   ratpercent_physint |
                  L1. |   .0126848   .0058163     2.18   0.029     .0012851    .0240846
                      |
        donor_physint |
                  L1. |  -.0073036   .0084475    -0.86   0.387    -.0238605    .0092532
                      |
donor_physint_physint |
                  L1. |   .0005104   .0018541     0.28   0.783    -.0031236    .0041443
                      |
              polity2 |
                  L1. |   .0030226   .0007768     3.89   0.000     .0015002     .004545
                      |
     lneconaidpcbygdp |
                  L1. |   .2532927   .0082749    30.61   0.000     .2370741    .2695113
                      |
       lnworldaidecon |   .1375238   .0044057    31.21   0.000     .1288887    .1461589
                      |
        ln_population |
                  L1. |   .0518849   .0069094     7.51   0.000     .0383426    .0654271
                      |
             ln_trade |
                  L1. |   .0072409   .0013213     5.48   0.000     .0046512    .0098306
                      |
          dyad_colony |   .3800406   .0493071     7.71   0.000     .2834005    .4766806
            socialist |   -.103749   .0271538    -3.82   0.000    -.1569695   -.0505285
              ColdWar |  -.0546833   .0120902    -4.52   0.000    -.0783797   -.0309869
           coldwarsoc |   .1486943   .0163764     9.08   0.000     .1165971    .1807915
                      |
      ColdWar_physint |
                  L1. |   .0046232   .0020569     2.25   0.025     .0005917    .0086546
                      |
                  war |
                  L1. |  -.0078587    .009788    -0.80   0.422    -.0270428    .0113254
                      |
             post2001 |   -.002275   .0081069    -0.28   0.779    -.0181642    .0136142
           region_SSA |   .2972225   .0299623     9.92   0.000     .2384975    .3559474
         region_Latin |   .0572167   .0319716     1.79   0.074    -.0054465    .1198799
          region_MENA |  -.1470377   .0362782    -4.05   0.000    -.2181416   -.0759338
      region_EAsiaPac |   .0983308   .0338241     2.91   0.004     .0320369    .1646248
                _cons |  -3.439313   .1344936   -25.57   0.000    -3.702915    -3.17571
----------------------+----------------------------------------------------------------
             /sigma_u |   .3350064   .0073182    45.78   0.000     .3206629    .3493498
             /sigma_e |   .4052135   .0022579   179.46   0.000      .400788     .409639
----------------------+----------------------------------------------------------------
                  rho |   .4059993   .0106771                      .3852164    .4270506
---------------------------------------------------------------------------------------
        24,430  left-censored observations
        17,505     uncensored observations
             0 right-censored observations

. 
. tab year if e(sample)

       year |      Freq.     Percent        Cum.
------------+-----------------------------------
       1983 |      1,614        3.85        3.85
       1984 |      1,633        3.89        7.74
       1985 |      1,652        3.94       11.68
       1986 |      1,652        3.94       15.62
       1987 |      1,633        3.89       19.52
       1988 |      1,652        3.94       23.46
       1989 |      1,652        3.94       27.39
       1990 |      1,709        4.08       31.47
       1991 |      1,652        3.94       35.41
       1992 |      1,669        3.98       39.39
       1993 |      1,651        3.94       43.33
       1994 |      1,965        4.69       48.01
       1995 |      2,000        4.77       52.78
       1996 |      2,006        4.78       57.57
       1997 |      2,026        4.83       62.40
       1998 |      2,281        5.44       67.84
       1999 |      2,239        5.34       73.18
       2000 |      2,236        5.33       78.51
       2001 |      2,264        5.40       83.91
       2002 |      2,239        5.34       89.25
       2003 |      2,264        5.40       94.64
       2004 |      2,246        5.36      100.00
------------+-----------------------------------
      Total |     41,935      100.00

. 
. unique countryname if e(sample)
Number of unique values of countryname is  113
Number of records is  41935

. estadd scalar countries = r(sum): neilsen

. 
. unique donorname if e(sample)
Number of unique values of donorname is  21
Number of records is  41935

. estadd scalar donors = r(sum): neilsen

. 
. unique dyadnum if e(sample)
Number of unique values of dyadnum is  2364
Number of records is  41935

. estadd scalar dyads= r(sum): neilsen

. 
. * how many countries are condemned in the window of this model?
. unique countryname if e(sample) & PUBRES == 1
Number of unique values of countryname is  24
Number of records is  3007

. 
. * the esarey-demeritt model
. eststo esdem3: xttobit lneconaidpcbygdp PUBRES lagXpub l.physint l.alliance allXpub l.donorallyneighbor2 neiXpub l.s3un s3unXpub l.lnreftotal l.lnnytimes l.ratpercent 
> l.donor_physint l.polity2 l.lneconaidpcbygdp lnworldaidecon l.ln_rgdpc l.ln_population l.ln_trade dyad_colony socialist ColdWar coldwarsoc l.war post2001 region_SSA re
> gion_Latin region_MENA region_EAsiaPac if(inmysample==1), ll(0) intpoints(19)

Obtaining starting values for full model:

Iteration 0:   log likelihood = -7100.9626
Iteration 1:   log likelihood = -5870.5781
Iteration 2:   log likelihood = -5794.5833
Iteration 3:   log likelihood = -5794.1166
Iteration 4:   log likelihood = -5794.1165

Fitting full model:

Iteration 0:   log likelihood = -22431.991  
Iteration 1:   log likelihood = -18268.453  
Iteration 2:   log likelihood = -14927.208  
Iteration 3:   log likelihood = -14551.438  
Iteration 4:   log likelihood = -14481.198  
Iteration 5:   log likelihood = -14480.371  
Iteration 6:   log likelihood = -14480.369  
Iteration 7:   log likelihood = -14480.369  

Random-effects tobit regression                 Number of obs     =     35,234
Group variable: dyadnum                         Number of groups  =      2,088

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          1
                                                              avg =       16.9
                                                              max =         21

Integration method: mvaghermite                 Integration pts.  =         19

                                                Wald chi2(29)     =    3420.06
Log likelihood  = -14480.369                    Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
  lneconaidpcbygdp |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
            PUBRES |  -.1765117   .0308994    -5.71   0.000    -.2370735   -.1159499
           lagXpub |   .1638345   .0395002     4.15   0.000     .0864156    .2412534
                   |
           physint |
               L1. |  -.0110041   .0023452    -4.69   0.000    -.0156007   -.0064076
                   |
          alliance |
               L1. |   .0642385   .0292676     2.19   0.028     .0068751    .1216018
                   |
           allXpub |    .366581   .0924328     3.97   0.000      .185416    .5477459
                   |
donorallyneighbor2 |
               L1. |   .0296146   .0293513     1.01   0.313     -.027913    .0871421
                   |
           neiXpub |   .1186502   .0386036     3.07   0.002     .0429886    .1943118
                   |
              s3un |
               L1. |  -.0011951   .0258184    -0.05   0.963    -.0517983    .0494081
                   |
          s3unXpub |   .1857216   .0634295     2.93   0.003     .0614022    .3100411
                   |
        lnreftotal |
               L1. |    .003351   .0019392     1.73   0.084    -.0004498    .0071518
                   |
         lnnytimes |
               L1. |  -.0057141    .004665    -1.22   0.221    -.0148574    .0034292
                   |
        ratpercent |
               L1. |  -.0724084   .0219174    -3.30   0.001    -.1153656   -.0294511
                   |
     donor_physint |
               L1. |  -.0033737   .0048826    -0.69   0.490    -.0129435    .0061961
                   |
           polity2 |
               L1. |   .0037215   .0008608     4.32   0.000     .0020344    .0054087
                   |
  lneconaidpcbygdp |
               L1. |   .2339916    .008987    26.04   0.000     .2163775    .2516058
                   |
    lnworldaidecon |    .158111   .0049048    32.24   0.000     .1484978    .1677242
                   |
          ln_rgdpc |
               L1. |  -.1037091   .0120149    -8.63   0.000    -.1272577   -.0801604
                   |
     ln_population |
               L1. |   .0379896   .0078247     4.86   0.000     .0226534    .0533258
                   |
          ln_trade |
               L1. |   .0106235    .001492     7.12   0.000     .0076993    .0135477
                   |
       dyad_colony |   .3976222   .0515094     7.72   0.000     .2966656    .4985788
         socialist |  -.1136252   .0284988    -3.99   0.000    -.1694819   -.0577686
           ColdWar |  -.0405516   .0115865    -3.50   0.000    -.0632607   -.0178425
        coldwarsoc |   .1583148   .0173274     9.14   0.000     .1243537    .1922759
                   |
               war |
               L1. |  -.0215195    .010972    -1.96   0.050    -.0430243   -.0000148
                   |
          post2001 |   .0014182   .0133745     0.11   0.916    -.0247955    .0276318
        region_SSA |   .1530784   .0341649     4.48   0.000     .0861165    .2200403
      region_Latin |    .031556   .0351941     0.90   0.370    -.0374232    .1005352
       region_MENA |  -.1747403   .0414905    -4.21   0.000    -.2560602   -.0934204
   region_EAsiaPac |   .0445272   .0364871     1.22   0.222    -.0269861    .1160406
             _cons |  -2.984327   .1744726   -17.10   0.000    -3.326287   -2.642367
-------------------+----------------------------------------------------------------
          /sigma_u |   .3420225   .0082696    41.36   0.000     .3258143    .3582306
          /sigma_e |    .422575   .0025805   163.76   0.000     .4175172    .4276327
-------------------+----------------------------------------------------------------
               rho |   .3958037   .0117294                      .3730081    .4189614
------------------------------------------------------------------------------------
        20,586  left-censored observations
        14,648     uncensored observations
             0 right-censored observations

. 
. tab year if e(sample)

       year |      Freq.     Percent        Cum.
------------+-----------------------------------
       1982 |      1,539        4.37        4.37
       1983 |      1,558        4.42        8.79
       1984 |      1,558        4.42       13.21
       1985 |      1,596        4.53       17.74
       1986 |      1,558        4.42       22.16
       1987 |      1,558        4.42       26.59
       1988 |      1,501        4.26       30.85
       1989 |      1,539        4.37       35.21
       1990 |      1,558        4.42       39.64
       1991 |      1,557        4.42       44.05
       1992 |      1,575        4.47       48.52
       1993 |      1,556        4.42       52.94
       1994 |      1,727        4.90       57.84
       1995 |      1,738        4.93       62.77
       1996 |      1,705        4.84       67.61
       1997 |      1,782        5.06       72.67
       1998 |      1,948        5.53       78.20
       1999 |      1,906        5.41       83.61
       2000 |      1,923        5.46       89.07
       2001 |      1,928        5.47       94.54
       2002 |      1,924        5.46      100.00
------------+-----------------------------------
      Total |     35,234      100.00

. 
. * how many countries are condemned in the window of this model?
. unique countryname if e(sample) & PUBRES == 1
Number of unique values of countryname is  25
Number of records is  3199

. unique countryname if e(sample)
Number of unique values of countryname is  100
Number of records is  35234

. estadd scalar countries = r(sum): esdem3

. 
. unique donorname if e(sample)
Number of unique values of donorname is  21
Number of records is  35234

. estadd scalar donors = r(sum): esdem3

. 
. unique dyadnum if e(sample)
Number of unique values of dyadnum is  2088
Number of records is  35234

. estadd scalar dyads= r(sum): esdem3

. 
. 
. esttab neilsen esdem3 using "percapita.rtf", title("State-dependence in Dyadic Bilateral Aid Per Capita Divided by GDP per Capita") longtable replace keep(L.lneconaidp
> cbygdp L.physint PUBRES lagXpub L.alliance L.alliance_physint allXpub L.donorallyneighbor2 L.allyneighbor2_physint neiXpub L.s3un L.s3un_physint s3unXpub) order(L.lnec
> onaidpcbygdp L.physint PUBRES lagXpub L.alliance L.alliance_physint allXpub L.donorallyneighbor2 L.allyneighbor2_physint neiXpub L.s3un L.s3un_physint s3unXpub) eqlabe
> ls(,none) nomtitles nodepvars coeflabels(L.lneconaidpcbygdp  "DV\$_{i(t-1)}$" L.physint  "Physical Integrity Violations\$_{i(t-1)}$" PUBRES "UNCHR Resolution\$_{i(t-1)
> }$" lagXpub "DV\$_{i(t-1)}$ * Resolution\$_{i(t-1)}$" L.alliance "Alliance\$_{i(t-1)}$" L.alliance_physint "Alliance\$_{i(t-1)}$ * Violations\$_{i(t-1)}$" allXpub "All
> iance\$_{i(t-1)}$ * Resolution\$_{i(t-1)}$" L.donorallyneighbor2 "Ally Neighbor\$_{i(t-1)}$" L.allyneighbor2_physint "Ally Neighbor\$_{i(t-1)}$ * Violations\$_{i(t-1)}
> $" neiXpub "Ally Neighbor\$_{i(t-1)}$ * Resolution\$_{i(t-1)}$" L.s3un "UN Voting Similarity\$_{i(t-1)}$" L.s3un_physint "UN Similarity\$_{i(t-1)}$ * Violations\$_{i(t
> -1)}$" s3unXpub "UN Similarity\$_{i(t-1)}$ * Resolution\$_{i(t-1)}$") noabbrev wrap gaps varwidth(48) align(r) substitute(\_ _) stats(N dyads countries donors, labels(
> "Observations" "Dyads" "Recipients" "Donors"))
(output written to percapita.rtf)

. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. 
. *****************************************************
. * Reviewer table only
. * Neilsen data
. * dyadic aid analysis
. * Lebovic/Voeten UNHCR ordinal variable
. *****************************************************
. 
. * create common sample for old and new models
. 
. clear all

. set mem 1000M
set memory ignored.
    Memory no longer needs to be set in modern Statas; memory adjustments are performed on the fly automatically.

. set more off

. set matsize 800

. 
. 
. ** merge in public resolution data
. use jprworkdatanew.dta, clear

. rename YEAR year 

. rename CCODE countrynumcode_g

. save jpr_merge.dta, replace
file jpr_merge.dta saved

. 
. use "dat2.dta", clear

. 
. merge m:1 year countrynumcode_g year using jpr_merge.dta

    Result                           # of obs.
    -----------------------------------------
    not matched                        51,079
        from master                    50,316  (_merge==1)
        from using                        763  (_merge==2)

    matched                            69,741  (_merge==3)
    -----------------------------------------

. drop if _merge==2
(763 observations deleted)

. 
. tsset dyadnum year
       panel variable:  dyadnum (unbalanced)
        time variable:  year, 1980 to 2006, but with gaps
                delta:  1 unit

. 
. gen allXpub = UNHRC*l.alliance
(66,759 missing values generated)

. gen neiXpub = UNHRC*l.donorallyneighbor2
(66,633 missing values generated)

. gen s3unXpub = UNHRC*l.s3un
(66,693 missing values generated)

. 
. * use the ordinal UNHRC variable from the Lebovic and Voeten data set
. gen lagXpub = UNHRC*l.lneconaidpc
(66,864 missing values generated)

. 
. * the esarey-demeritt model
. eststo esdem3: xttobit lneconaidpc UNHRC lagXpub l.physint l.alliance allXpub l.donorallyneighbor2 neiXpub l.s3un s3unXpub l.lnreftotal l.lnnytimes l.ratpercent l.dono
> r_physint l.polity2 l.lneconaidpc lnworldaidecon l.ln_rgdpc l.ln_population l.ln_trade dyad_colony socialist ColdWar coldwarsoc l.war post2001 region_SSA region_Latin 
> region_MENA region_EAsiaPac if(inmysample==1), ll(0) intpoints(19)

Obtaining starting values for full model:

Iteration 0:   log likelihood = -73007.013
Iteration 1:   log likelihood = -71848.079
Iteration 2:   log likelihood = -71720.407
Iteration 3:   log likelihood = -71718.175
Iteration 4:   log likelihood = -71718.173

Fitting full model:

Iteration 0:   log likelihood = -53497.582  
Iteration 1:   log likelihood = -47355.189  
Iteration 2:   log likelihood = -44826.764  
Iteration 3:   log likelihood = -44551.988  
Iteration 4:   log likelihood = -44492.163  
Iteration 5:   log likelihood = -44492.026  
Iteration 6:   log likelihood = -44492.026  

Random-effects tobit regression                 Number of obs     =     35,234
Group variable: dyadnum                         Number of groups  =      2,088

Random effects u_i ~ Gaussian                   Obs per group:
                                                              min =          1
                                                              avg =       16.9
                                                              max =         21

Integration method: mvaghermite                 Integration pts.  =         19

                                                Wald chi2(29)     =    4568.02
Log likelihood  = -44492.026                    Prob > chi2       =     0.0000

------------------------------------------------------------------------------------
       lneconaidpc |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------------+----------------------------------------------------------------
             UNHRC |  -.3144025   .0497022    -6.33   0.000    -.4118171   -.2169879
           lagXpub |     .04533   .0069572     6.52   0.000     .0316942    .0589658
                   |
           physint |
               L1. |  -.0644664   .0160653    -4.01   0.000    -.0959538    -.032979
                   |
          alliance |
               L1. |    .444104   .2128013     2.09   0.037     .0270211     .861187
                   |
           allXpub |  -.0838035   .0879397    -0.95   0.341    -.2561623    .0885552
                   |
donorallyneighbor2 |
               L1. |  -.1524762   .2094856    -0.73   0.467    -.5630605    .2581081
                   |
           neiXpub |   .2101991   .0613904     3.42   0.001     .0898761    .3305221
                   |
              s3un |
               L1. |   -.213507   .1841825    -1.16   0.246     -.574498     .147484
                   |
          s3unXpub |   .2057976   .0866931     2.37   0.018     .0358823    .3757129
                   |
        lnreftotal |
               L1. |   .0468511   .0134973     3.47   0.001     .0203969    .0733053
                   |
         lnnytimes |
               L1. |  -.0954708   .0324323    -2.94   0.003     -.159037   -.0319047
                   |
        ratpercent |
               L1. |  -.3104474   .1530556    -2.03   0.043    -.6104309   -.0104639
                   |
     donor_physint |
               L1. |  -.0201173   .0337913    -0.60   0.552     -.086347    .0461124
                   |
           polity2 |
               L1. |   .0317377   .0059811     5.31   0.000     .0200149    .0434605
                   |
       lneconaidpc |
               L1. |   .3804467   .0106867    35.60   0.000     .3595012    .4013923
                   |
    lnworldaidecon |   .9773386   .0336721    29.03   0.000     .9113425    1.043335
                   |
          ln_rgdpc |
               L1. |  -.3575264   .0843895    -4.24   0.000    -.5229267    -.192126
                   |
     ln_population |
               L1. |   .4422175   .0561438     7.88   0.000     .3321777    .5522573
                   |
          ln_trade |
               L1. |   .0776489   .0101882     7.62   0.000     .0576804    .0976175
                   |
       dyad_colony |   1.866253   .3729149     5.00   0.000     1.135353    2.597153
         socialist |  -.6284279   .2028588    -3.10   0.002    -1.026024   -.2308318
           ColdWar |  -.0419906   .0796532    -0.53   0.598     -.198108    .1141268
        coldwarsoc |    1.08977   .1190985     9.15   0.000     .8563412    1.323199
                   |
               war |
               L1. |  -.0628275   .0760413    -0.83   0.409    -.2118657    .0862107
                   |
          post2001 |   .1192801   .0922996     1.29   0.196    -.0616238     .300184
        region_SSA |   .8867722   .2452749     3.62   0.000     .4060422    1.367502
      region_Latin |   .2281773   .2523468     0.90   0.366    -.2664133    .7227679
       region_MENA |  -1.584882   .2938904    -5.39   0.000    -2.160896   -1.008867
   region_EAsiaPac |   .1446858   .2622664     0.55   0.581    -.3693468    .6587184
             _cons |  -22.05548   1.225604   -18.00   0.000    -24.45762   -19.65334
-------------------+----------------------------------------------------------------
          /sigma_u |   2.488066   .0623271    39.92   0.000     2.365907    2.610225
          /sigma_e |   2.973277   .0192612   154.37   0.000     2.935526    3.011028
-------------------+----------------------------------------------------------------
               rho |   .4118512   .0123879                      .3877549    .4362847
------------------------------------------------------------------------------------
        20,586  left-censored observations
        14,648     uncensored observations
             0 right-censored observations

. 
. tab year if e(sample)

       year |      Freq.     Percent        Cum.
------------+-----------------------------------
       1982 |      1,539        4.37        4.37
       1983 |      1,558        4.42        8.79
       1984 |      1,558        4.42       13.21
       1985 |      1,596        4.53       17.74
       1986 |      1,558        4.42       22.16
       1987 |      1,558        4.42       26.59
       1988 |      1,501        4.26       30.85
       1989 |      1,539        4.37       35.21
       1990 |      1,558        4.42       39.64
       1991 |      1,557        4.42       44.05
       1992 |      1,575        4.47       48.52
       1993 |      1,556        4.42       52.94
       1994 |      1,727        4.90       57.84
       1995 |      1,738        4.93       62.77
       1996 |      1,705        4.84       67.61
       1997 |      1,782        5.06       72.67
       1998 |      1,948        5.53       78.20
       1999 |      1,906        5.41       83.61
       2000 |      1,923        5.46       89.07
       2001 |      1,928        5.47       94.54
       2002 |      1,924        5.46      100.00
------------+-----------------------------------
      Total |     35,234      100.00

. tab UNHRC if e(sample)

                             UNHRC |      Freq.     Percent        Cum.
-----------------------------------+-----------------------------------
                    not considered |     28,550       81.03       81.03
     considered, but not condemned |      1,103        3.13       84.16
            confidential procedure |      1,195        3.39       87.55
advisory procedure/statement chair |      1,221        3.47       91.02
                 public resolution |      3,165        8.98      100.00
-----------------------------------+-----------------------------------
                             Total |     35,234      100.00

. 
. * how many countries are condemned in the window of this model?
. unique countryname if e(sample)
Number of unique values of countryname is  100
Number of records is  35234

. estadd scalar countries = r(sum): esdem3

. 
. unique donorname if e(sample)
Number of unique values of donorname is  21
Number of records is  35234

. estadd scalar donors = r(sum): esdem3

. 
. unique dyadnum if e(sample)
Number of unique values of dyadnum is  2088
Number of records is  35234

. estadd scalar dyads= r(sum): esdem3

. 
. esttab esdem3 using "unchrcontinuous.rtf", title("State-dependence in Dyadic Bilateral Aid Flows") longtable replace keep(L.lneconaidpc L.physint UNHRC lagXpub L.allia
> nce allXpub L.donorallyneighbor2 neiXpub L.s3un s3unXpub) order(L.lneconaidpc L.physint UNHRC lagXpub L.alliance allXpub L.donorallyneighbor2 neiXpub L.s3un s3unXpub) 
> eqlabels(,none) nomtitles nodepvars coeflabels(L.lneconaidpc "DV\$_{i(t-1)}$" L.physint  "Physical Integrity Violations\$_{i(t-1)}$" UNHRC "UNCHR Action\$_{i(t-1)}$" l
> agXpub "DV\$_{i(t-1)}$ * UNCHR\$_{i(t-1)}$" L.alliance "Alliance\$_{i(t-1)}$" allXpub "Alliance\$_{i(t-1)}$ * UNCHR\$_{i(t-1)}$" L.donorallyneighbor2 "Ally Neighbor\$_
> {i(t-1)}$" neiXpub "Ally Neighbor\$_{i(t-1)}$ * UNCHR\$_{i(t-1)}$" L.s3un "UN Voting Similarity\$_{i(t-1)}$" s3unXpub "UN Similarity\$_{i(t-1)}$ * UNCHR\$_{i(t-1)}$") 
> noabbrev wrap gaps varwidth(48) align(r) substitute(\_ _) stats(N dyads countries donors, labels("Observations" "Dyads" "Recipients" "Donors"))
(output written to unchrcontinuous.rtf)

. 
. 
. log close
      name:  <unnamed>
       log:  D:\Dropbox\jesarey_documents\Naming and Shaming\naming-and-shaming-replication\esarey-demeritt-nameshame.log
  log type:  text
 closed on:  10 Jun 2016, 12:51:34
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------
